Scrapa Usage API

Credits spent this month, the balance on top of them, and the same split per key.

GitHub OpenAPI

Operations 1

GET /usage Usage this month #

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/scrapa-app:scrapa-app-usage-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

scrapa-app-usage-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: 'scrapa.app: the browser and scraping Usage API'
  version: 0.1.0
  description: One call reads a web page and hands it back as markdown, HTML, text, links, a screenshot or a PDF, through a plain HTTP request or a real Chromium, whichever the page turns out to need. Every request leaves through a residential proxy or your own. A page the site blocked and a URL our policy refused cost nothing, unless your own `browser.actions` script ran in the page first. Anything we broke costs nothing, and every answer says what it cost. Every operation here is also an MCP tool (see x-mcp-tools), authenticated by the same `sc_` key. Writing TypeScript or JavaScript? `npm i @scrapa/sdk` is one typed method per endpoint here.
servers:
- url: https://api.scrapa.app/v1
tags:
- name: Usage
  description: Credits spent this month, the balance on top of them, and the same split per key.
paths:
  /usage:
    get:
      operationId: get_usage_get
      tags:
      - Usage
      summary: Usage this month
      description: Credits spent this billing month against the plan's grant, the purchased balance on top of it, managed-proxy megabytes against the plan's ceiling, when the month rolls over, and the same split per API key. Free, and worth reading before a bulk run.
      security:
      - bearerAuth: []
      responses:
        '200':
          description: Usage this month
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data: {}
        '400':
          description: 'VALIDATION_ERROR / INVALID_URL / SSRF_DENIED: the field path, the rule, and the bound a range failed against; never the value you sent. An includeTags or excludeTags selector too slow for the page your own browser.actions script built is charged, like every refusal that script could have caused.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: 'UNAUTHORIZED / INVALID_TOKEN: the key is missing, unknown or revoked.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '402':
          description: 'PLAN_GATE: a capability this plan does not include. Waiting cannot clear it.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: 'AUP_DENIED / FORBIDDEN: our policy said no. Retrying the same URL cannot help.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '422':
          description: 'UPSTREAM_BLOCKED: the site said no. Try another engine, pool or country. NAV_TIMEOUT: timeoutMs ran out before the page was ready, or while the call waited its turn. Raise timeoutMs. PROXY_REFUSED: the proxy would not place the call: check your own proxy, or ask the managed pool for a wider place. FILE_TOO_LARGE: the file is bigger than raw returns whole, or than we read into text; ask for markdown or text instead of raw, or download it yourself. DOCUMENT_TIMEOUT: the PDF or Word file arrived, but we could not read it into text in time. We read one file for 15 s at most, and stop sooner if timeoutMs runs out; ask for raw, or try a smaller file. ACTION_FAILED: one of your browser.actions steps did not work on the page. The message names the step and why, so fix that step. None of these cost you anything, unless your own browser.actions script ran in the page first: then a refusal the script could have caused is charged, because the script may already have read the page. The credits guide lists which: https://docs.scrapa.app/en/guides/credits.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          description: 'RATE_LIMIT_EXCEEDED / QUOTA_EXCEEDED: waiting clears it. Retry-After says when.'
          headers:
            Retry-After:
              description: When present, how many seconds to wait before trying again.
              schema:
                type: integer
                minimum: 0
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '503':
          description: 'SERVICE_UNAVAILABLE: we broke it, or the browser engine is not running here. Already refunded.'
          headers:
            Retry-After:
              description: When present, how many seconds to wait before trying again.
              schema:
                type: integer
                minimum: 0
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        default:
          description: Any other failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      x-sdk:
        method: usage.get
        returns: UsageDto
      x-credits: 0 credits.
components:
  schemas:
    ApiError:
      type: object
      required:
      - error
      properties:
        error:
          type: object
          required:
          - code
          - message
          properties:
            code:
              type: string
              description: What went wrong, as a word a program can check.
            message:
              type: string
              description: What went wrong, as a sentence.
            messageKey:
              type: string
              description: '`message` as a key, to show it in your reader''s language, with `params` filling its blanks.'
            params:
              type: object
              additionalProperties:
                type:
                - string
                - number
              description: The values that fill `messageKey`'s blanks, such as a limit.
            details:
              description: More about this error, such as retryAfterSecs.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: An `sc_` API key from the console.
x-mcp-tools:
- name: scrape
  title: Scrape a page
  description: 'Read one web page and hand it back as markdown, HTML, plain text, its links, a screenshot, a PDF, or the fields you ask for, read off the page by a model. `engine: "auto"` (the default) makes a plain HTTP request first and re-reads the page in a real Chromium when the body turns out to be a JavaScript shell, so you pay for a browser only when the page needed one. To send a search form or a JSON query, use `method: "POST"` with a `body`; to download a file exactly as the site sent it, ask for `formats: ["raw"]`. A link to a PDF or a Word file is read into text too, headings and paragraphs included. To click a cookie banner, type into a search box or run a script before the page is read, send `browser.actions`. Every request leaves through a residential proxy, or through your own with `proxy: { pool: "custom", server }`. The answer says which engine replied, where the page finally was and what it cost.'
  inputSchema:
    type: object
    properties:
      url:
        type: string
        minLength: 1
        maxLength: 8192
        description: The page to read. An http(s) URL. Private and loopback hosts are refused.
      engine:
        description: How to read it. "fetch" is a plain HTTP request; "browser" renders the page in a real Chromium; "auto" (the default) fetches first and escalates to the browser when the body turns out to be a JavaScript shell, billing whichever engine answered. A POST and "raw" always use "fetch", so leave it out for them.
        type: string
        enum:
        - auto
        - fetch
        - browser
      escalate:
        description: 'Whether to try again a different way when the first attempt is blocked. On by default. `false` stops after one try. The site''s refusal is your answer, and it costs nothing, unless your own `browser.actions` script ran in the page first. It is how you bound a call: with `auto`, trying again is what charges the browser price instead of the fetch one. A POST is sent once, so it is off for a POST.'
        type: boolean
      method:
        default: GET
        description: 'The HTTP method. "POST" sends `body` to the URL, for a search form or a JSON query. It is sent once: never retried and never sent again another way, because sending it twice could repeat what it did.'
        type: string
        enum:
        - GET
        - POST
      body:
        description: 'What a POST sends, at most 64 KB. Set its type in `headers`: `{"content-type": "application/json"}` for JSON, or `application/x-www-form-urlencoded` for a form. If the site redirects, a 301, 302 or 303 reads the next page with GET and without the body; a 307 or 308 sends it again only if the protocol, host and port stay the same, and otherwise stops and names the new address.'
        type: string
      retry:
        default: 0
        description: How many extra tries to give a page the site blocks, each from a different address. 0 (the default) takes the site's first no as the answer. A blocked page costs nothing, so a try that is blocked again is free, but it takes as long as the first one did, so the call can run that many times longer. Once your `browser.actions` steps click, type, press a key or run a script on a page, it is not tried again, so nothing is done twice. If one of your scripts ran in it, the block is charged.
        type: integer
        minimum: 0
        maximum: 8
      formats:
        default:
        - markdown
        description: 'What to hand back. "screenshot" and "pdf" come back as base64 and need the browser engine; asking for both costs no more than one. "extract" is the page read into fields by a model, and needs an `extract` block saying which ones. A link to a PDF or a Word (.docx) file is read into text, so the text formats work on it too. We read files up to 25 MB, and from a PDF the first 200 pages and the first 5 million characters. Reading a file costs what the engine costs: 1 credit with fetch, 5 with the browser. A Word file that holds more than 32 MB once unzipped answers FILE_TOO_LARGE, and a file link that answers a short web page instead of the file answers UPSTREAM_BLOCKED, both at no charge. A dead link is the exception: its 404 or 410 page is the site''s answer, and comes back with that status at the fetch price. "raw" is the file exactly as the site sent it, as base64 with its content type: a PDF report, an image, a spreadsheet. It uses the fetch engine and holds up to 5 MB; a larger file answers FILE_TOO_LARGE at no charge, never cut short.'
        minItems: 1
        maxItems: 8
        type: array
        items:
          type: string
          enum:
          - markdown
          - html
          - text
          - links
          - screenshot
          - pdf
          - extract
          - raw
      onlyMainContent:
        default: true
        description: 'Read only the page''s main content into `markdown`, `text` and `extract`: the article or the product, without the menus, ads and related links around it. On by default. Set `false` for the whole page. When the main content is under 50 words, you get the whole page instead. `html` and `links` always hold the whole page.'
        type: boolean
      includeTags:
        description: CSS selectors for the parts of the page to keep, such as `["h1", ".price"]`. `markdown`, `text` and `extract` then hold only what they match, in page order, and `onlyMainContent` no longer applies. Hidden parts are never kept. Up to 20 selectors, 256 characters each.
        maxItems: 20
        type: array
        items:
          type: string
          minLength: 1
          maxLength: 256
      excludeTags:
        description: CSS selectors for the parts of the page to leave out of `markdown`, `text` and `extract`, such as `[".comments", "#newsletter"]`. Up to 20 selectors, 256 characters each.
        maxItems: 20
        type: array
        items:
          type: string
          minLength: 1
          maxLength: 256
      expect:
        description: 'What the page should answer with. Set `"json"` when you are reading an API: anything else that comes back (a maintenance notice, a "checking your browser" page, a login form) is then not your answer. It costs nothing, and we try again from another address instead of handing you a page you cannot parse. Without it, whatever the page returns is your answer.'
        type: string
        enum:
        - json
      extract:
        description: What to pull out of the page, for the "extract" format. A model reads the page and fills in the shape you asked for. Give it a JSON Schema, a sentence, or both. It reads what the page says; it does not do arithmetic over it, so ask for the numbers and add them up in your own code.
        type: object
        properties:
          schema:
            description: 'The shape you want back, as JSON Schema: an object whose properties are the fields you need. A field the page does not mention comes back null; nothing is invented to fill it.'
            type: object
            propertyNames:
              type: string
            additionalProperties: {}
          prompt:
            description: 'What to pull out, in your own words: `the price, the author and the date it was published`. Use it on its own for a quick read, or beside `schema` to say what a field means.'
            type: string
            minLength: 1
            maxLength: 1000
        additionalProperties: false
      proxy:
        description: Where the request leaves from. Defaults to the managed residential pool.
        type: object
        properties:
          pool:
            default: residential
            description: Which exit to leave through. "residential" is the managed pool, metered by the megabyte; "custom" is your own proxy, free on every plan, bytes never billed.
            type: string
            enum:
            - residential
            - custom
          server:
            description: Your own proxy, `http(s)://[user:pass@]host:port`. Required for pool "custom", refused for the managed one.
            type: string
            maxLength: 512
          country:
            description: 'Where the call should look like it comes from, ISO 3166-1 alpha-2 (`us`, `br`). Name one and the managed pool leaves from that country. Leave it out and the page sees a US browser, from an address we pick. A scrape or a map on the managed pool makes one exception: a site whose address ends in `.br`, `.de`, `.es`, `.fr`, `.it`, `.jp`, `.nl`, `.pl` or `.uk` is read from its own country. The browser''s clock and languages follow the country on every pool.'
            type: string
            pattern: ^[A-Za-z]{2}$
          state:
            description: 'A state or region inside `country`, by name: `california`, `são paulo`. Managed pool only. Spell the name out, since an abbreviation like `sp` finds nobody. In the US and Brazil the browser''s clock follows the state.'
            type: string
            minLength: 2
            maxLength: 60
            pattern: ^\p{L}[\p{L}\p{M} .'-]*$
          city:
            description: 'A city inside `country`, by name: `curitiba`, `new york`. Managed pool only. Most calls leave from that city and a few from elsewhere in its state, as the pool''s own location data places them. A place with nobody in it right now answers `PROXY_REFUSED` at no charge; ask for the state or the country alone.'
            type: string
            minLength: 2
            maxLength: 60
            pattern: ^\p{L}[\p{L}\p{M} .'-]*$
        additionalProperties: false
      browser:
        description: How to render it. Only the browser engine reads these. With `auto` they apply if the page turns out to need one, except `actions`, which always use the browser.
        type: object
        properties:
          waitUntil:
            description: When the page counts as loaded. "load" (the default) waits for images and stylesheets; "domcontentloaded" is the fastest and stops at the HTML; "networkidle" waits until the page stops asking for things. Every page gets a short settle after this whichever you pick.
            type: string
            enum:
            - load
            - domcontentloaded
            - networkidle
          waitForSelector:
            description: Wait until this CSS selector is on the page. It is the dependable way to read something a script draws. If it never shows up, the call comes back as a timeout at no charge, rather than the half-built page.
            type: string
            minLength: 1
            maxLength: 256
          waitMs:
            description: Wait this many milliseconds after the page settles, for the scripts no selector describes. It comes out of `timeoutMs`, never on top of it.
            type: integer
            minimum: 0
            maximum: 30000
          viewport:
            description: The window size the page is rendered in, 1280×800 unless you say. Set it when a site serves a different layout by width.
            type: object
            properties:
              width:
                type: integer
                minimum: 320
                maximum: 3840
              height:
                type: integer
                minimum: 240
                maximum: 3840
            required:
            - width
            - height
            additionalProperties: false
          fullPage:
            description: 'Screenshot the whole scrollable page instead of just the window. A long page makes a large answer: the image comes back as base64 inside the response.'
            type: boolean
          actions:
            minItems: 1
            maxItems: 50
            type: array
            items:
              oneOf:
              - type: object
                properties:
                  type:
                    type: string
                    const: wait
                  milliseconds:
                    description: How long to wait, in milliseconds. All the waits together have to fit inside `timeoutMs`.
                    type: integer
                    minimum: 1
                    maximum: 60000
                  selector:
                    description: Wait until this CSS selector is on the page. If it never shows up, the step fails.
                    type: string
                    minLength: 1
                    maxLength: 256
                required:
                - type
                additionalProperties: false
                description: Wait a fixed time, or until a CSS selector is on the page. Give `milliseconds` or `selector`, not both.
              - type: object
                properties:
                  type:
                    type: string
                    const: click
                  selector:
                    type: string
                    minLength: 1
                    maxLength: 256
                    description: The CSS selector of what to click. The first match gets the click, and the step waits for it to show up.
                  all:
                    description: Click every visible match, not just the first. A selector that matches nothing is then not an error, which suits a cookie banner only some visitors see.
                    type: boolean
                required:
                - type
                - selector
                additionalProperties: false
                description: Click something on the page.
              - type: object
                properties:
                  type:
                    type: string
                    const: write
                  text:
                    type: string
                    minLength: 1
                    maxLength: 1000
                    description: What to type, up to 1,000 characters.
                required:
                - type
                - text
                additionalProperties: false
                description: Type text into the field that has focus. Click the field in the step before this one.
              - type: object
                properties:
                  type:
                    type: string
                    const: press
                  key:
                    type: string
                    minLength: 1
                    maxLength: 64
                    description: 'The key''s name: "Enter", "Tab", "Escape", "ArrowDown", or two together such as "Control+A".'
                required:
                - type
                - key
                additionalProperties: false
                description: Press a key.
              - type: object
                properties:
                  type:
                    type: string
                    const: scroll
                  direction:
                    type: string
                    enum:
                    - up
                    - down
                  selector:
                    description: Scroll this element instead of the whole page, such as a list with its own scroll bar.
                    type: string
                    minLength: 1
                    maxLength: 256
                required:
                - type
                - direction
                additionalProperties: false
                description: Scroll one screen up or down.
              - type: object
                properties:
                  type:
                    type: string
                    const: screenshot
                  fullPage:
                    description: Take the whole scrollable page instead of just the window.
                    type: boolean
                required:
                - type
                additionalProperties: false
                description: Take a screenshot at this point. It comes back in `actions.screenshots`, as base64.
              - type: object
                properties:
                  type:
                    type: string
                    const: scrape
                required:
                - type
                additionalProperties: false
                description: Keep the page's address and HTML at this point. They come back in `actions.scrapes`. All the scrape steps in one call can keep 5 MB of HTML together.
              - type: object
                properties:
                  type:
                    type: string
                    const: executeJavascript
                  script:
                    type: string
                    minLength: 1
                    maxLength: 8000
                    description: The body of an async function, up to 8,000 characters, such as `return document.title`. It runs in the page, beside the page's own scripts. What it returns comes back in `actions.javascriptReturns` as JSON, or as null when JSON cannot hold it. All the scripts in one call can return 64 KB together. Once a script starts, the call is charged even if that script throws, a later step fails, the page crashes or times out, the site blocks it, the script leads to an address we refuse, your own proxy says no, or an `includeTags` or `excludeTags` selector is too slow for the page it built, because the script may already have read the page. A failure on our side (a 5xx) is still refunded.
                required:
                - type
                - script
                additionalProperties: false
                description: Run your own JavaScript in the page.
            description: 'Steps to run in the page before it is read, in the order you list them. A step can wait, click, type, press a key, scroll, take a screenshot, keep the HTML or run a script. Steps always use the browser engine, at the browser price. The formats you ask for read the page as the last step left it. Up to 50 steps, at most 10 of them screenshots or scrapes. If one fails, the call answers ACTION_FAILED, which names the step and why. That costs nothing, unless one of your scripts started, the one that failed included: then the call is charged.'
        additionalProperties: false
      headers:
        description: Extra request headers to send to the page, such as an authorization token, a cookie or a custom user agent. The connection's own headers cannot be set.
        type: object
        propertyNames:
          type: string
          maxLength: 128
        additionalProperties:
          type: string
          maxLength: 4096
      timeoutMs:
        description: How long to give the page before giving up, in milliseconds. A page that never arrives costs nothing, unless your own `browser.actions` script ran in the page first.
        type: integer
        minimum: 1000
        maximum: 60000
      maxAge:
        description: 'The oldest copy of the page you accept, in milliseconds, up to 3600000 (one hour). If we still hold a copy of the same URL that your account read within that time, from the same country and with the same engine, you get it back for 0 credits and the answer says `cached: true`. If not, we read the page now and keep a copy for up to an hour, unless the page still needs JavaScript (`metadata.needsJs`). We may drop a copy sooner, to make room or on a deploy, and a batch keeps its own copies, apart from single calls. `0` always reads the page now, and keeps the copy for the calls after it. `extract` is still charged, because the model reads the copy again. Leave `maxAge` out to read the page fresh every time. A POST, or a call with `headers`, your own proxy, `browser` options, a screenshot, a PDF, `raw` or `escalate: false`, is always read fresh.'
        type: integer
        minimum: 0
        maximum: 3600000
    required:
    - url
    additionalProperties: false


# --- truncated at 32 KB (102 KB total) ---
# Full source: https://artifacts.apis.io/scrapa-app/openapi/scrapa-app-usage-api-openapi.yml