Authentication
Every Platform API request (api.scrapy.infralyon.com/v1/...) must be authenticated with a Scrapy.io API key. The same key is used for publisher execution hosts ({publisher}.p.scrapy.infralyon.com).
Create a key
- Sign in to the Scrapy.io console.
- Open API keys (account / integrations).
- Create or regenerate a key.
- Copy it once — treat it like a password.
Keys typically look like:
scrapy_api_AbCdEfGhIjKlMnOp
Canonical header (recommended)
Authorization: Bearer scrapy_api_...
curl "https://api.scrapy.infralyon.com/v1/tools?limit=1" \
-H "Authorization: Bearer $SCRAPY_API_KEY"
Alternate header
X-API-Key: scrapy_api_...
curl "https://api.scrapy.infralyon.com/v1/tools?limit=1" \
-H "X-API-Key: $SCRAPY_API_KEY"
Both are supported. Prefer Bearer in docs, SDKs, and production clients.
What not to do
- Do not pass the key as a query parameter (
?token=/?apiKey=). - Do not embed keys in public repos, screenshots, or client-side frontend code that ships to browsers.
- Do not send a
userId(or similar) to “select” whose data to read — ownership comes only from the key.
How ownership works
API key
→ validateApiKey
→ authenticated user / account
→ all private resources filtered by that user
For private resources (runs, schedules, datasets):
| Client sends | Server uses |
|---|---|
runId | runId and authenticated user id |
scheduleId | scheduleId and authenticated user id |
If the resource exists but belongs to another account, the API responds with 404 Not found (not 403), so resource ids are not enumerable across tenants.
Missing or invalid key
{
"error": {
"type": "unauthorized",
"message": "Authentication token was not provided",
"doc_url": "https://docs.scrapy.io/errors/unauthorized"
}
}
HTTP status: 401.
CORS
Browser apps calling api.scrapy.infralyon.com must use allowed origins configured for your deployment. Server-to-server calls (backend, workers, CI) do not need CORS.