API documentation

Platform API integration rules

A short integration reference: pass the API key correctly, choose a response structure, make the first request, handle errors, and validate mock payloads.

Where to start

What this page locks in

This page collects the rules that do not depend on a specific API method: authentication, response version, error handling, retries, mock API usage, and launch checks.

Use the API reference for API method parameters, schemas, and method-specific examples. Use platform pages to compare coverage and method groups.

Keep this page as the team baseline for new integrations. It complements the API reference instead of repeating it.
A key on every request

Authentication

Send your API key in the `X-API-Key` header on every Platform API request.

The key does not inherit from a dashboard session. Backend services, workers, and background jobs must attach this header explicitly.

  • Store the key in secret storage and rotate it when access changes or you suspect exposure.
  • Do not place the key in browser code, public repositories, client bundles, or logs.
  • Limit access to the key by environment and service whenever possible.
Response version

Choose a response structure

V1 and V2 expose the same API method catalog, but they return different data structures. Pick the version before you build the client and keep it fixed in integration config.

Do not mix V1 and V2 in the same processing flow. It makes mapping, caching, tests, and maintenance harder.

V1
V1 original response

Keeps the source platform response shape with minimal Scrape Storm reshaping.

Use when

Migrations, backward compatibility, and clients that already depend on platform-native fields.

Default to V2. Keep V1 only for compatibility or migration of existing clients.
Transport check

Make your first live request

After you choose a version, verify the integration on one live API method: base URL, headers, query parameters, timeout, and error handling.

HTTP method GET
Endpoint /api/v2/youtube.com/profile/about-by-user-identifier
Example query parameter user_identifier=mkbhd
Header X-API-Key

This example uses the YouTube `profile/about-by-user-identifier` API method. Replace `user_identifier` with a test identifier from your own scenario.

One successful response proves transport and the top-level response structure only. Validate every API method you plan to ship, along with limits, pricing, and failure handling.
Response envelope

Validate the response shape

Public platform API methods in both V1 and V2 use the same outer envelope: `success`, `status`, and `data`. Collection methods can also include top-level `pagination`.

The version choice changes the schema inside `data`, not the transport wrapper. Use the API reference for the exact payload fields of the API method you selected.

Response case Top-level fields What to read first
Successful response success, status, data `data` holds the method payload.
Paginated success success, status, pagination, data `pagination` stays top-level; method payload still lives in `data`.
Error response success, status, error, meta Branch on HTTP status and `error.code`.
Do not infer V1 or V2 from the envelope. Fix the version in the URL and client config, then parse the API method schema from that version's API reference.
Errors and retries

Handle errors by code, not by text

Errors use one shared envelope. Branch on HTTP status and `error.code`. The `message` field is fine for display or logs, but not as application control flow.

  • `401`, `402`, and `422` should not be retried until the cause changes.
  • `429 RATE_LIMIT_EXCEEDED` should only retry after `Retry-After` or `error.retry_after_seconds`.
  • `500` and `503` should retry with bounded backoff and a hard attempt limit.
HTTP status Error code Client action
401 Unauthorized UNAUTHORIZED Check the API key and environment. Do not loop the same request with the same key.
422 Validation failed VALIDATION_FAILED Fix the request parameters. The same input will return the same error.
402 Insufficient credits INSUFFICIENT_CREDITS Stop the flow until the balance or account limits are updated.
429 Concurrent connections exceeded CONCURRENT_CONNECTIONS_EXCEEDED Reduce parallel work per API key or queue requests.
429 Rate limit exceeded RATE_LIMIT_EXCEEDED Wait for the published retry interval and coordinate retries across workers.
503 Endpoint unavailable ENDPOINT_UNAVAILABLE Apply API method-level backoff instead of pausing the entire integration if other methods are healthy.
500 Internal server error INTERNAL_SERVER_ERROR Retry with bounded backoff. After the attempt limit, log and escalate through monitoring.
For `RATE_LIMIT_EXCEEDED`, the only source of truth for the next retry time is `Retry-After` or `error.retry_after_seconds`.
Mock API

Validate shape on mock data

Mock API methods return static JSON examples without calling the source platforms. Use them for client development, UI work, and parser tests.

Mock API does not prove method availability, fresh data, limits, pricing, or launch behavior. Repeat the same scenario against live API before launch.
  • Do not use mock to verify data freshness.
  • Do not copy mock values into live integration logic.
  • Compare only the envelope, field names, and baseline response structure.
Mock API https://www.scrapestorm.net/api-mock
Example https://www.scrapestorm.net/api-mock/v2/youtube.com/profile/about-by-user-identifier
API reference
Before launch

Production checklist

Review these checks before live traffic and before increasing worker concurrency.

  1. 01

    Response version is fixed

    New clients use V2. V1 is only allowed for compatibility or migration of an existing integration.

  2. 02

    The API key is stored as a secret

    The key lives in secret storage and stays out of frontend code, public repositories, client bundles, and logs.

  3. 03

    Error handling keys off machine-readable codes

    Client branches depend on HTTP status and `error.code`. `message` is not used in business logic.

  4. 04

    Retries are bounded

    `RATE_LIMIT_EXCEEDED` waits for `Retry-After` or `error.retry_after_seconds`. `402` and `422` do not retry unchanged input. `500` and `503` have backoff and an attempt cap.

  5. 05

    Concurrency is controlled per API key

    A queue or rate limiter caps simultaneous requests from workers, cron jobs, and background processes.

  6. 06

    Mock and live are validated separately

    Mock validates payload shape. Live API validates real parameters, limits, availability, and credit usage.

  7. 07

    API method pricing is confirmed

    Check the cost of the API methods you plan to use before traffic ramps up.