MiroMiro Code API

The Code API from MiroMiro — 1 operation(s) for code.

GitHub OpenAPI

Operations 1

GET /code URL → code: a live section as a clean component #

Work with this as data

Every API 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 apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • 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 API
curl "https://apis.io/api/v1/apis/miromiro-app:miromiro-app-code-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

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

OpenAPI Specification

miromiro-app-code-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: MiroMiro Design Extraction Code API
  version: 1.0.0
  description: 'Turn any live website URL into design data: production-ready section code, brand identity, the full design-token system, and every asset (images, SVGs, fonts, videos, audio, Lottie). Built for developers and AI agents — also available as an MCP server at https://miromiro.app/mcp.


    Auth: Bearer key (`mm_live_…`). Get one free at https://miromiro.app/api/onboarding — 300 credits/month, no card. Docs: https://miromiro.app/api/docs (append .md to any docs URL for raw Markdown).'
  contact:
    name: MiroMiro
    url: https://miromiro.app/api
servers:
- url: https://miromiro.app/api/v1
  description: Production
security:
- bearerAuth: []
tags:
- name: Code
paths:
  /code:
    get:
      operationId: extractCode
      summary: 'URL → code: a live section as a clean component'
      description: 'The flagship. Loads the page in a real browser (every key, no surcharge), reads the styles, theme and images it actually shows, and returns a self-contained component (Tailwind, HTML+CSS, React or Vue) plus the design tokens that section uses. Omit `selector` and the hero section is auto-detected; the `sections` field lists every extractable section so you can call again for a specific one. For jsx/vue, repeated structures collapse into a data array with .map()/v-for.


        **Cost:** 10 credits (+5 with render=true). Cache hits and failed calls cost 0.'
      security:
      - bearerAuth: []
      parameters:
      - name: url
        in: query
        required: true
        description: The page to extract from. Scheme optional — `stripe.com` works.
        schema:
          type: string
          examples:
          - stripe.com
      - name: section
        in: query
        required: false
        description: A part of the page by name, resolved on the page itself from its ids, classes and headings, or failing those from what it contains (prices for pricing, blockquotes for testimonials, details/questions for faq) - for callers that cannot see the markup. Ignored when selector is given. Not on the page → 404 listing the sections that do exist.
        schema:
          type: string
          enum:
          - hero
          - header
          - footer
          - pricing
          - features
          - testimonials
          - faq
          - cta
      - name: selector
        in: query
        required: false
        description: 'CSS selector of the section to extract (e.g. #hero, .pricing-card), best taken from a previous response''s `sections`. Omit both selector and section to auto-detect the hero. No match → 404 listing the sections that do exist.'
        schema:
          type: string
      - name: framework
        in: query
        required: false
        description: Output flavor. tailwind, html, jsx and vue return component code. elementor returns an importable Elementor template (save `code` as a .json file); shopify returns a theme section (save `code` as sections/<name>.liquid). The two builder targets embed their own scoped CSS, including responsive and hover rules.
        schema:
          type: string
          enum:
          - tailwind
          - html
          - jsx
          - vue
          - elementor
          - shopify
          default: tailwind
      - name: name
        in: query
        required: false
        description: 'Component name for jsx output (ignored by tailwind, html and vue). Not part of the cache key: renaming a cached section costs 0 credits.'
        schema:
          type: string
      - name: theme
        in: query
        required: false
        description: 'Which color scheme to extract. Default light: the page''s light styles are the component, its prefers-color-scheme: dark rules ride along as dark: variants. theme=dark promotes the dark rules and custom properties to the component itself. Works whether the page expresses its themes as a prefers-color-scheme media query or as a root attribute/class its CSS is scoped to ([data-theme=dark], html.dark). Themes switched purely in JavaScript cannot be selected: you get the page default plus a hint. No extra credits.'
        schema:
          type: string
          enum:
          - light
          - dark
          default: light
      - name: inline_svg
        in: query
        required: false
        description: Keep large inline SVGs inside `code`. By default any inline SVG over 2 KB (logo walls, illustrations) is moved to a permanent hosted .svg file and referenced with an <img> that keeps its classes, size and color, so the component stays small enough for an agent to use as-is. true = fully self-contained code. No extra credits.
        schema:
          type: boolean
          default: false
      - name: render
        in: query
        required: false
        description: 'Load the page in a real browser and run its JavaScript before extracting. Use for client-rendered sites (React/Next/SPAs). Adds 5 credits. Available on every key, free included. Usually not needed: when a plain call comes back as a JavaScript app shell, with script-injected styles, or refused by the site (401/403/406) or timed out, the server re-runs it in the browser by itself at no extra charge and `usage.autoRender` says so. Pass render=true to force the browser for assets that only load on scroll (lazy images, video, Lottie), for screenshot=true, or when a result is still thin after that automatic pass. When a 403 says the browser was refused too, or the site blocks browser rendering, there is nothing to retry. /v1/code always runs in the browser on every key at no surcharge, so render=true is not needed there (only with screenshot=true). On /v1/extract, render=true only permits the browser: the plain read still runs first, and the surcharge is charged only if the browser was actually needed (`usage.autoRender` says when it was not).'
        schema:
          type: boolean
          default: false
      - name: fresh
        in: query
        required: false
        description: Skip the 24-hour cache and re-extract from the live page (charged normally). The fresh result replaces the cached copy. Without it, identical repeat calls within 24 hours are served from cache at 0 credits.
        schema:
          type: boolean
          default: false
      - name: screenshot
        in: query
        required: false
        description: Requires render=true. Captures a screenshot in the same browser session - `true` for the 1440x900 viewport, `full` for the entire page height - and adds a `screenshot` field (public image URL, live for 7 days) to the response. No extra credits beyond the render surcharge. Captured on fresh extractions; a cache hit returns the screenshot stored with the cached result.
        schema:
          type: string
          enum:
          - 'true'
          - full
      - name: fields
        in: query
        required: false
        description: 'Comma-separated list of response fields to return. Trims the response only — the credit cost is unchanged. `url` is always included. Allowed: code, css, tokens, theme, assets, selector, section, autoDetected, sections, framework, previewUrl, downloadUrl, pagePreviewUrl, svgNote.'
        schema:
          type: string
          examples:
          - code,css
      responses:
        '200':
          description: Successful extraction.
          headers:
            X-RateLimit-Limit:
              description: Per-minute request allowance for your plan.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests left in the current 60s window.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
            X-Quota-Limit:
              description: Monthly credit quota. Omitted on unlimited plans.
              schema:
                type: integer
            X-Quota-Remaining:
              description: Credits remaining this month. Omitted on unlimited plans.
              schema:
                type: integer
            X-Cache:
              description: HIT = served from the 24h cache (0 credits) · MISS = extracted live · BYPASS = fresh=true skipped the cache.
              schema:
                type: string
                enum:
                - HIT
                - MISS
                - BYPASS
            X-Request-Id:
              description: Unique id for this call (req_…), present on every response. Errors echo it as data.requestId. Include it when reporting a problem.
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    description: The resolved URL that was extracted.
                  code:
                    type: string
                    description: The component, paste-ready.
                  previewUrl:
                    type: string
                    format: uri
                    description: A page showing this section rendered from the same extraction, as HTML + CSS. Absent only if storing it failed.
                  downloadUrl:
                    type: string
                    format: uri
                    description: 'The code exactly as returned, as a file in the requested format: .jsx, .vue, .html, .elementor.json or .liquid. Absent only if storing it failed.'
                  pagePreviewUrl:
                    type: string
                    format: uri
                    description: 'The whole page: every section of this URL extracted in the last day, assembled in page order. Grows as more sections are extracted. Both preview pages offer the document as an .html download.'
                  svgNote:
                    type: string
                    description: Present when large inline SVGs were moved to hosted .svg files (also listed in assets.images). inline_svg=true keeps them inline.
                  css:
                    type:
                    - string
                    - 'null'
                    description: Companion stylesheet (always for framework=html; for tailwind, jsx and vue only when @keyframes are needed; null for elementor and shopify, whose file contains its CSS).
                  tokens:
                    type: object
                    description: Design tokens this section actually uses.
                    additionalProperties: true
                  theme:
                    type: string
                    enum:
                    - light
                    - dark
                    description: Whether the CAPTURED code reads light or dark. Measured from the page - its declared root theme when it has one, else the backgrounds the cascade resolved - and never echoed back from the theme parameter, so a request the page could not honour still reports what you actually received. A site that expresses themes only through a prefers-color-scheme media query returns its light branch unless you pass theme=dark. Absent when the page declares no theme and no readable background was found.
                  assets:
                    type: object
                    description: Asset URLs the section references.
                    additionalProperties: true
                  selector:
                    type: string
                    description: The CSS selector that was extracted (the auto-detected or resolved one when you did not pass a selector).
                  section:
                    type: string
                    enum:
                    - hero
                    - header
                    - footer
                    - pricing
                    - features
                    - testimonials
                    - faq
                    - cta
                    description: 'Only when section= was passed: the name that was resolved.'
                  autoDetected:
                    type: boolean
                  sections:
                    type: array
                    description: 'Every extractable section on the page, best first: { selector, label, elements, hasHeading, preview, order }. order is where the section starts on the page (1 = topmost); sort by it to rebuild a whole page in sequence. Content that no single element wraps (a logo row and a heading loose in one long container) is listed with a selector like mm-range(div.page|2|5): pass it back like any other.'
                    items:
                      type: object
                      additionalProperties: true
                  framework:
                    type: string
                    enum:
                    - tailwind
                    - html
                    - jsx
                    - vue
                    - elementor
                    - shopify
                  summary:
                    type: object
                    description: 'Extraction quality: elements, mappedToTailwind, arbitrary, styledCoverage (0-100 quality signal), repeatedGroups, truncated.'
                    additionalProperties: true
                  hint:
                    type: string
                    description: Present only when the extraction looks degraded (client-rendered app shell, runtime-injected styles, or none of the page's stylesheets could be fetched). Says what to do — usually retry with render=true, or retry the same call in a moment when the stylesheets failed.
                  screenshot:
                    type: string
                    description: 'Present only when a screenshot was requested: public URL of the page capture (1440x900 viewport, or full page with screenshot=full), live for 7 days.'
                  usage:
                    type: object
                    description: Metering for this call. creditsSpent is 0 on cache hits.
                    properties:
                      creditsThisMonth:
                        type: number
                      monthlyLimit:
                        type:
                        - number
                        - 'null'
                        description: null = unlimited plan
                      remaining:
                        type:
                        - number
                        - 'null'
                      creditsSpent:
                        type: number
                      cached:
                        type: boolean
                      overageCredits:
                        type: number
                        description: 'Present only when a paid key is past its quota: billed overage credits used this period.'
                      packCredits:
                        type: number
                        description: 'Present only when the account holds a credit pack (one-off credits that never expire): the balance left after this call. Packs are drawn after the monthly quota and before overage.'
                      teamCredits:
                        type: number
                        description: 'Present only when a team owner shares credits with this account: what is left of this month''s share after this call. Team credits are spent before the account''s own.'
                      warning:
                        type: string
                        description: 'Present from 80% of a hard monthly quota (no pack, no overage): how much is used and a one-click top-up link. Relay it to the user.'
                      autoRender:
                        type: string
                        description: 'Present when the server re-ran this call in a real browser by itself, at no extra charge: the plain read was a JavaScript app shell (or its styles are injected by scripts), or the site refused it (401/403/406) or timed out. A ready-to-show sentence; it also means render=true is not needed for this page.'
                      topUpUrl:
                        type: string
                        description: 'Present with `warning`: a signed link (valid 7 days) that opens Stripe Checkout for a 500-credit top-up on this key''s account, no login. The same link appears in 429 quota_exceeded messages.'
        '400':
          description: Invalid input — missing url, unknown fields name, or bad parameter value. The statusMessage lists what is valid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: boolean
                  statusCode:
                    type: integer
                  statusMessage:
                    type: string
                    description: Human- and agent-readable explanation, including what to do next (e.g. "Rate limit exceeded. Retry in 42s.").
                  data:
                    type: object
                    description: Machine-readable error detail. Branch on code, not on the English message.
                    properties:
                      code:
                        type: string
                        description: Stable error code.
                        enum:
                        - invalid_request
                        - invalid_api_key
                        - billing_issue
                        - render_requires_plan
                        - site_requires_plan
                        - target_blocked
                        - not_found
                        - target_timeout
                        - unprocessable_content
                        - rate_limited
                        - quota_exceeded
                        - key_limit_reached
                        - target_error
                        - target_unreachable
                        - render_unavailable
                        - internal_error
                      requestId:
                        type:
                        - string
                        - 'null'
                        description: The X-Request-Id of this call - the lookup key for support.
        '401':
          description: Missing, invalid, or revoked API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: boolean
                  statusCode:
                    type: integer
                  statusMessage:
                    type: string
                    description: Human- and agent-readable explanation, including what to do next (e.g. "Rate limit exceeded. Retry in 42s.").
                  data:
                    type: object
                    description: Machine-readable error detail. Branch on code, not on the English message.
                    properties:
                      code:
                        type: string
                        description: Stable error code.
                        enum:
                        - invalid_request
                        - invalid_api_key
                        - billing_issue
                        - render_requires_plan
                        - site_requires_plan
                        - target_blocked
                        - not_found
                        - target_timeout
                        - unprocessable_content
                        - rate_limited
                        - quota_exceeded
                        - key_limit_reached
                        - target_error
                        - target_unreachable
                        - render_unavailable
                        - internal_error
                      requestId:
                        type:
                        - string
                        - 'null'
                        description: The X-Request-Id of this call - the lookup key for support.
        '402':
          description: 'billing_issue: the key''s subscription is past due, canceled, or inactive. render_requires_plan: legacy, not returned since 2026-09-23 - render=true is available on every key since 2026-10-14. site_requires_plan: /site/page on a key whose plan does not include whole-page extraction (free keys).'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: boolean
                  statusCode:
                    type: integer
                  statusMessage:
                    type: string
                    description: Human- and agent-readable explanation, including what to do next (e.g. "Rate limit exceeded. Retry in 42s.").
                  data:
                    type: object
                    description: Machine-readable error detail. Branch on code, not on the English message.
                    properties:
                      code:
                        type: string
                        description: Stable error code.
                        enum:
                        - invalid_request
                        - invalid_api_key
                        - billing_issue
                        - render_requires_plan
                        - site_requires_plan
                        - target_blocked
                        - not_found
                        - target_timeout
                        - unprocessable_content
                        - rate_limited
                        - quota_exceeded
                        - key_limit_reached
                        - target_error
                        - target_unreachable
                        - render_unavailable
                        - internal_error
                      requestId:
                        type:
                        - string
                        - 'null'
                        description: The X-Request-Id of this call - the lookup key for support.
        '422':
          description: 'The target URL could not be parsed as a page: it is a media file (image, video, audio - the matching asset endpoint returns the file itself), a data response instead of a page (JSON, plain text, XML sitemap, PDF), or the selected element produced no renderable content.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: boolean
                  statusCode:
                    type: integer
                  statusMessage:
                    type: string
                    description: Human- and agent-readable explanation, including what to do next (e.g. "Rate limit exceeded. Retry in 42s.").
                  data:
                    type: object
                    description: Machine-readable error detail. Branch on code, not on the English message.
                    properties:
                      code:
                        type: string
                        description: Stable error code.
                        enum:
                        - invalid_request
                        - invalid_api_key
                        - billing_issue
                        - render_requires_plan
                        - site_requires_plan
                        - target_blocked
                        - not_found
                        - target_timeout
                        - unprocessable_content
                        - rate_limited
                        - quota_exceeded
                        - key_limit_reached
                        - target_error
                        - target_unreachable
                        - render_unavailable
                        - internal_error
                      requestId:
                        type:
                        - string
                        - 'null'
                        description: The X-Request-Id of this call - the lookup key for support.
        '429':
          description: 'Per-minute rate limit, monthly credit quota, or this additional key''s own monthly limit exceeded (data.code: rate_limited, quota_exceeded or key_limit_reached). The statusMessage says which, and when to retry.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: boolean
                  statusCode:
                    type: integer
                  statusMessage:
                    type: string
                    description: Human- and agent-readable explanation, including what to do next (e.g. "Rate limit exceeded. Retry in 42s.").
                  data:
                    type: object
                    description: Machine-readable error detail. Branch on code, not on the English message.
                    properties:
                      code:
                        type: string
                        description: Stable error code.
                        enum:
                        - invalid_request
                        - invalid_api_key
                        - billing_issue
                        - render_requires_plan
                        - site_requires_plan
                        - target_blocked
                        - not_found
                        - target_timeout
                        - unprocessable_content
                        - rate_limited
                        - quota_exceeded
                        - key_limit_reached
                        - target_error
                        - target_unreachable
                        - render_unavailable
                        - internal_error
                      requestId:
                        type:
                        - string
                        - 'null'
                        description: The X-Request-Id of this call - the lookup key for support.
        '503':
          description: render=true requested but JS rendering is not available. Retry without render.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: boolean
                  statusCode:
                    type: integer
                  statusMessage:
                    type: string
                    description: Human- and agent-readable explanation, including what to do next (e.g. "Rate limit exceeded. Retry in 42s.").
                  data:
                    type: object
                    description: Machine-readable error detail. Branch on code, not on the English message.
                    properties:
                      code:
                        type: string
                        description: Stable error code.
                        enum:
                        - invalid_request
                        - invalid_api_key
                        - billing_issue
                        - render_requires_plan
                        - site_requires_plan
                        - target_blocked
                        - not_found
                        - target_timeout
                        - unprocessable_content
                        - rate_limited
                        - quota_exceeded
                        - key_limit_reached
                        - target_error
                        - target_unreachable
                        - render_unavailable
                        - internal_error
                      requestId:
                        type:
                        - string
                        - 'null'
                        description: The X-Request-Id of this call - the lookup key for support.
      tags:
      - Code
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'API key from the MiroMiro console, format mm_live_… Sent as `Authorization: Bearer mm_live_…`.'