RapiDoc · Example Payload

Rapidoc Javascript Api Example

Using RapiDoc JavaScript API to programmatically control the component

DocumentationPlatformWeb ComponentsOpenAPI

Rapidoc Javascript Api Example is an example object payload from RapiDoc, with 3 top-level fields. It illustrates the shape of data this provider's APIs accept or return.

Top-level fields

descriptioncodenotes

Example Payload

Raw ↑
{
  "description": "Using RapiDoc JavaScript API to programmatically control the component",
  "code": {
    "javascript": "// Get reference to the rapi-doc element\nconst rapidocEl = document.getElementById('my-api-docs');\n\n// Load a new OpenAPI spec dynamically\nrapidocEl.loadSpec('https://api.example.com/openapi.json');\n\n// Listen for spec-loaded event\nrapidocEl.addEventListener('spec-loaded', (event) => {\n    console.log('Spec loaded:', event.detail);\n});\n\n// Listen for before-try event to inject auth token\nrapidocEl.addEventListener('before-try', (event) => {\n    const request = event.detail.request;\n    request.headers.append('Authorization', 'Bearer ' + getAuthToken());\n});\n\n// Listen for after-try event to process responses\nrapidocEl.addEventListener('after-try', (event) => {\n    const response = event.detail.response;\n    console.log('Response status:', response.status);\n});",
    "html": "<rapi-doc id=\"my-api-docs\" spec-url=\"/openapi.json\"></rapi-doc>"
  },
  "notes": "RapiDoc fires spec-loaded, before-try, after-try, api-server-change, and before-render events for integration with surrounding application logic."
}

Work with this as data

Every example here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for examples

4 MCP tools reach this
  • find_examplesBrowse and filter every example in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This example
curl "https://apis.io/api/v1/examples/rapidoc-javascript-api-example"
All examples
curl "https://apis.io/api/v1/examples?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.