API docs

zpe-scraper

mount / · base https://scrape.zpe.vc · v5.0.0 · 10 operations · 6 write · 0 need no account · beta

the document this app serves now. Contract: https://scrape.zpe.vc/_/api/v1/openapi.json · sha256 0851eab0d2b2

POST /_/api/v1/scrape POST /_/api/v1/scrape postScrape

POST /_/api/v1/scrape

Parameters

No parameters.

Request body application/json · required

fieldtyperequirednotes
urlstring (uri)yesThe absolute address to scrape. The SSRF guard reads it before any browser opens, so a refused address costs nothing.
formatsarray of "markdown" | "html" | "rawHtml" | "links" | "screenshot" | "screenshot@fullPage"noWhich readings to return. Defaults to markdown, html, rawHtml and links; duplicates are dropped.
onlyMainContentbooleannoDrop navigation, footers and other page chrome from the text. Defaults to true.
waitForintegernoMilliseconds to wait after the page loads before reading it. Defaults to 0.
timeoutintegernoThe job's ceiling in milliseconds. Defaults to 60000 or the deployment's MAX_JOB_MS, whichever is lower.
headersobjectnoExtra request headers for the target, at most 20. Host and hop-by-hop headers are refused.

Responses

statusmeaningbody
200The page, read into the formats asked for, with the browser time it cost and how that time was measured.object
400The request could not be read, or the address was refused before any fetch: a blocked host, a blocked address, a scheme other than http or https, or credentials in the URL.object
401The credential is missing, or the door did not recognise it.object
402Payment required: this account holds no credit, or its balance cannot cover the browser time a scrape reserves before it starts.object
403This key may not do that: it is granted a different app, its scope does not cover this verb, or the request was refused by the site's own robots.txt.object
422The page could not be read: the address did not resolve, the redirect chain was too long, the body exceeded the size cap, or the driver reported an error.object
429Too many requests: this key has spent its request ceiling, or this account already has its browser slots open. Retry after the period the answer names.object
500This app failed while answeringobject
502The browser the scrape opened did not answer, so nothing could be read.object
503A service this app needs did not answer: the door could not check the credential, the ledger binding a metered call needs is absent, or the browser the scrape needs is not bound here.object
504The address did not answer in the time the request allowed.object

Example

POST /_/api/v1/scrape, with a token from the door.

POST /_/api/v1/scrape
curl -X POST 'https://scrape.zpe.vc/_/api/v1/scrape' \
  -H 'Authorization: Bearer $ZPE_TOKEN' \
  -H 'content-type: application/json' \
  -d '{
  "url": "https://example.com",
  "formats": [
    "markdown"
  ],
  "onlyMainContent": false,
  "waitFor": 0,
  "timeout": 0,
  "headers": {}
}'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

POST /_/api/v1/map POST /_/api/v1/map postMap

POST /_/api/v1/map

Parameters

No parameters.

Request body application/json · required

fieldtyperequirednotes
urlstring (uri)yesThe absolute address whose links are listed. Answered from one guarded fetch, with no browser.

Responses

statusmeaningbody
200The links found at that address, filtered by the request, with the metered time the listing cost.object
400`url` is missing or is not a string, or the address was refused before any fetch: a blocked host, a blocked address, a scheme other than http or https, or credentials in the URL.object
401The credential is missing, or the door did not recognise it.object
402Payment required: this account holds no credit, or its balance cannot cover the time a listing reserves before it starts.object
403This key may not do that: it is granted a different app, its scope does not cover this verb, or the request was refused by the site's own robots.txt.object
422The page could not be read: the address did not resolve, the redirect chain was too long, or the body exceeded the size cap.object
429Too many requests: this key has spent its request ceiling. Retry after the period the answer names.object
500This app failed while answeringobject
503A service this app needs did not answer: the door could not check the credential, the ledger binding a metered call needs is absent, or the browser the scrape needs is not bound here.object

Example

POST /_/api/v1/map, with a token from the door.

POST /_/api/v1/map
curl -X POST 'https://scrape.zpe.vc/_/api/v1/map' \
  -H 'Authorization: Bearer $ZPE_TOKEN' \
  -H 'content-type: application/json' \
  -d '{
  "url": "https://example.com"
}'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

GET /_/api/v1/balance GET /_/api/v1/balance getBalance

GET /_/api/v1/balance

Parameters

No parameters.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200The credit this account holds, in milliseconds of browser time, and whether it is live or only observed.object
401The credential is missing, or the door did not recognise it.object
403This key may not do that: it is granted a different app, its scope does not cover this verb, or the request was refused by the site's own robots.txt.object
429Too many requests: this key has spent its request ceiling. Retry after the period the answer names.object
500This app failed while answeringobject
503A service this app needs did not answer: the door could not check the credential, the ledger binding a metered call needs is absent, or the browser the scrape needs is not bound here.object

Example

GET /_/api/v1/balance, with a token from the door.

GET /_/api/v1/balance
curl -X GET 'https://scrape.zpe.vc/_/api/v1/balance' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

GET /_/api/v1/usage GET /_/api/v1/usage getUsage

GET /_/api/v1/usage

Parameters

No parameters.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200This account's twenty most recent scrapes, newest first, with the address, time and charge of each.object
401The credential is missing, or the door did not recognise it.object
403This key may not do that: it is granted a different app, its scope does not cover this verb, or the request was refused by the site's own robots.txt.object
429Too many requests: this key has spent its request ceiling. Retry after the period the answer names.object
500This app failed while answeringobject
503A service this app needs did not answer: the door could not check the credential, the ledger binding a metered call needs is absent, or the browser the scrape needs is not bound here.object

Example

GET /_/api/v1/usage, with a token from the door.

GET /_/api/v1/usage
curl -X GET 'https://scrape.zpe.vc/_/api/v1/usage' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

GET /_/api/v1/keys GET /_/api/v1/keys getKeys

GET /_/api/v1/keys

Parameters

No parameters.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200Every key this account has minted, with its label, when it was created and last used, and whether it is revoked.object
401The credential is missing, or the door did not recognise it.object
403This key may not do that: it is granted a different app, its scope does not cover this verb, or the request was refused by the site's own robots.txt.object
429Too many requests: this key has spent its request ceiling. Retry after the period the answer names.object
500This app failed while answeringobject
503A service this app needs did not answer: the door could not check the credential, the ledger binding a metered call needs is absent, or the browser the scrape needs is not bound here.object

Example

GET /_/api/v1/keys, with a token from the door.

GET /_/api/v1/keys
curl -X GET 'https://scrape.zpe.vc/_/api/v1/keys' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

POST /_/api/v1/keys POST /_/api/v1/keys postKeys

POST /_/api/v1/keys

Parameters

nameinrequiredtypenotes
Idempotency-KeyheadernostringA retry handle: a second POST carrying the same value answers `200` with the first call's key and label, `secret: null`, and mints nothing.

Request body application/json · optional

fieldtyperequirednotes
labelstringnoA name for the key, shown in `GET /_/api/v1/keys`. A live key with the same label is refused rather than duplicated.

Responses

statusmeaningbody
200A replay: this `Idempotency-Key` was already answered. The same key id and label the first call returned, `secret: null`, and nothing minted.object
201The key was minted. The secret is in this answer and nowhere else: it is stored as a keyed digest.object
400A live key with that label already exists, the `Idempotency-Key` was empty or longer than 200 characters, or the key could not be minted for a reason the answer names.object
401The credential is missing, or the door did not recognise it.object
403This key may not do that: it is granted a different app, its scope does not cover this verb, or the request was refused by the site's own robots.txt.object
429Too many requests: this key has spent its request ceiling. Retry after the period the answer names.object
500This app failed while answeringobject
503Keys cannot be minted here: this deployment has no token pepper or no store, or the door could not check the credential.object

Example

POST /_/api/v1/keys, with a token from the door.

POST /_/api/v1/keys
curl -X POST 'https://scrape.zpe.vc/_/api/v1/keys' \
  -H 'Authorization: Bearer $ZPE_TOKEN' \
  -H 'content-type: application/json' \
  -d '{
  "label": "string"
}'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

DELETE /_/api/v1/keys/{id} DELETE /_/api/v1/keys/:id deleteKeysById

DELETE /_/api/v1/keys/:id

Parameters

nameinrequiredtypenotes
idpathyesstringThe key's id, as `GET /v1/keys` answered it.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200The key is revoked. A second call for the same id answers `404`: there is no live key left to revoke.object
401The credential is missing, or the door did not recognise it.object
403This key may not do that: it is granted a different app, its scope does not cover this verb, or the request was refused by the site's own robots.txt.object
404No live key with that id belongs to this account.object
429Too many requests: this key has spent its request ceiling. Retry after the period the answer names.object
500This app failed while answeringobject
503A service this app needs did not answer: the door could not check the credential, the ledger binding a metered call needs is absent, or the browser the scrape needs is not bound here.object

Example

DELETE /_/api/v1/keys/:id, with a token from the door.

DELETE /_/api/v1/keys/{id}
curl -X DELETE 'https://scrape.zpe.vc/_/api/v1/keys/string' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

GET /_/api/v1/domains GET /_/api/v1/domains getDomains

GET /_/api/v1/domains

Parameters

No parameters.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200Every domain this account has claimed, with the state of each claim and the TXT record it was proved with.object
401The credential is missing, or the door did not recognise it.object
403This key may not do that: it is granted a different app, its scope does not cover this verb, or the request was refused by the site's own robots.txt.object
429Too many requests: this key has spent its request ceiling. Retry after the period the answer names.object
500This app failed while answeringobject
503A service this app needs did not answer: the door could not check the credential, the ledger binding a metered call needs is absent, or the browser the scrape needs is not bound here.object

Example

GET /_/api/v1/domains, with a token from the door.

GET /_/api/v1/domains
curl -X GET 'https://scrape.zpe.vc/_/api/v1/domains' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

POST /_/api/v1/domains POST /_/api/v1/domains postDomains

POST /_/api/v1/domains

Parameters

No parameters.

Request body application/json · required

fieldtyperequirednotes
domainstringyesA bare hostname like `example.com`. It is normalized to lower case, and a scheme or a path is refused.

Responses

statusmeaningbody
200The claim exists: proved, already proved, or waiting for the TXT record the answer names.object
400The body could not be read, or `domain` is not a bare hostname like example.com.object
401The credential is missing, or the door did not recognise it.object
403This key may not do that: it is granted a different app, its scope does not cover this verb, or the request was refused by the site's own robots.txt.object
429Too many requests: this key has spent its request ceiling. Retry after the period the answer names.object
500This app failed while answeringobject
503A service this app needs did not answer: the door could not check the credential, the ledger binding a metered call needs is absent, or the browser the scrape needs is not bound here.object

Example

POST /_/api/v1/domains, with a token from the door.

POST /_/api/v1/domains
curl -X POST 'https://scrape.zpe.vc/_/api/v1/domains' \
  -H 'Authorization: Bearer $ZPE_TOKEN' \
  -H 'content-type: application/json' \
  -d '{
  "domain": "string"
}'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

DELETE /_/api/v1/domains/{domain} DELETE /_/api/v1/domains/:domain deleteDomainsById

DELETE /_/api/v1/domains/:domain

Parameters

nameinrequiredtypenotes
domainpathyesstringThe bare hostname whose claim is dropped, as `GET /v1/domains` answered it.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200The claim is dropped, so the site's robots.txt rules apply to this account again.object
400That is not a domain this route can read.object
401The credential is missing, or the door did not recognise it.object
403This key may not do that: it is granted a different app, its scope does not cover this verb, or the request was refused by the site's own robots.txt.object
404No claim for that domain belongs to this account.object
429Too many requests: this key has spent its request ceiling. Retry after the period the answer names.object
500This app failed while answeringobject
503A service this app needs did not answer: the door could not check the credential, the ledger binding a metered call needs is absent, or the browser the scrape needs is not bound here.object

Example

DELETE /_/api/v1/domains/:domain, with a token from the door.

DELETE /_/api/v1/domains/{domain}
curl -X DELETE 'https://scrape.zpe.vc/_/api/v1/domains/string' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.