{"openapi":"3.1.0","info":{"title":"Stophy API","version":"1","description":"Each operation shows its method and its input: a JSON object body, path and query parameters, or a file upload.\n\nResponses leave out empty values: null, empty strings, empty objects and empty nested lists are not sent.\n\nText comes back whole. To get shorter responses, add ?maxTextLength=<characters> to the URL. Every text value longer than that is cut and ends with …. A screenshot is never cut, and a page whose text was cut has isTruncated set to true.\n\nThe x-cost-usd response header is what the request cost in dollars. An operation's description gives its pricing units and add-ons. The OpenAPI fields x-cost-usd and x-cost-usd-max are list-price estimates, not receipts or spending limits. When a call starts a job, check the job result for its total cost.\n\nWhen a response has a cursor, send it back unchanged with the same input to get the next page. When it has a page, send the next page number.\n\nEndpoints whose security includes {} also work without an API key: 10 requests a minute and 50 a day per IP, and no paging."},"servers":[{"url":"https://api.stophy.dev"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer"}},"schemas":{"Error":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string","description":"What went wrong and what to do next."},"code":{"type":"string","enum":["apiKeyRequired","busy","checkRunning","cliSessionCompleted","cliSessionExists","cliSessionNotFound","forbidden","freeLimit","insufficientCredits","internalError","inviteClaimed","inviteDisabled","inviteExpired","inviteUsedUp","invalidCliSession","invalidCliVerifier","invalidRequest","jobFinished","methodNotAllowed","notFound","payloadTooLarge","profileBusy","profileTooLarge","prohibitedPermission","promptInjectionDetected","rateLimited","sourceChanged","sourceRefused","siteNotRead","sourceTimeout","sourceUnavailable","unauthorized","unsupportedMediaType"]},"retryable":{"type":"boolean","description":"true when trying again can help."},"retryAfterSeconds":{"type":"integer"},"requestId":{"type":"string"},"requiredCredits":{"type":"number","description":"Older field: the most the call can cost, in $0.002 steps. Sent when the balance is too low."},"availableCredits":{"type":"number","description":"Older field: the balance in $0.002 steps. Sent with requiredCredits."},"requiredUsd":{"type":"number","description":"The most the call can cost, in dollars. Sent when the balance is too low."},"availableUsd":{"type":"number","description":"What is left on the account, in dollars. Sent with requiredUsd."},"billingUrl":{"type":"string","description":"Where to add money. Sent with requiredUsd."},"signupUrl":{"type":"string","const":"https://stophy.dev/signup","description":"Where a person gets a key. Sent with apiKeyRequired, freeLimit and an invalid key."},"signup":{"type":"string","const":"POST https://api.stophy.dev/v1/signup","description":"The call that gets an agent a key with no human. Sent next to signupUrl."}}},"search.input.schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/search.input.schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/search.input.schema0"}}]},"search.input.schema1":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/search.input.schema1"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/search.input.schema1"}}]},"search.input.schema2":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/search.input.schema2"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/search.input.schema2"}}]},"search.schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/search.schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/search.schema0"}}]},"scrape.input.schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/scrape.input.schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/scrape.input.schema0"}}]},"scrape.input.schema1":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/scrape.input.schema1"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/scrape.input.schema1"}}]},"scrape.input.schema2":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/scrape.input.schema2"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/scrape.input.schema2"}}]},"scrape.schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/scrape.schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/scrape.schema0"}}]},"extract.input.schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/extract.input.schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/extract.input.schema0"}}]},"browserTask.input.schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/browserTask.input.schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/browserTask.input.schema0"}}]},"browserTaskStatus.schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/browserTaskStatus.schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/browserTaskStatus.schema0"}}]},"parse.input.schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/parse.input.schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/parse.input.schema0"}}]},"parse.schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/parse.schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/parse.schema0"}}]},"crawl.input.schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/crawl.input.schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/crawl.input.schema0"}}]},"crawl.input.schema1":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/crawl.input.schema1"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/crawl.input.schema1"}}]},"crawl.input.schema2":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/crawl.input.schema2"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/crawl.input.schema2"}}]},"crawlStatus.schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/crawlStatus.schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/crawlStatus.schema0"}}]},"batchScrape.input.schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/batchScrape.input.schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/batchScrape.input.schema0"}}]},"batchScrape.input.schema1":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/batchScrape.input.schema1"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/batchScrape.input.schema1"}}]},"batchScrape.input.schema2":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/batchScrape.input.schema2"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/batchScrape.input.schema2"}}]},"batchScrapeStatus.schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/batchScrapeStatus.schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/batchScrapeStatus.schema0"}}]},"agent.input.schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/agent.input.schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/agent.input.schema0"}}]},"batchScrapeResults.schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/batchScrapeResults.schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/batchScrapeResults.schema0"}}]},"crawlResults.schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/crawlResults.schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/crawlResults.schema0"}}]},"monitorChange.schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/monitorChange.schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/monitorChange.schema0"}}]},"extractResult.schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/extractResult.schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/extractResult.schema0"}}]},"listEndpoints.26.schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/listEndpoints.26.schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/listEndpoints.26.schema0"}}]},"monitorCreate.27.schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/monitorCreate.27.schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/monitorCreate.27.schema0"}}]},"monitorUpdate.28.schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/monitorUpdate.28.schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/monitorUpdate.28.schema0"}}]}},"headers":{"RequestId":{"description":"The request id. Quote it when you report a problem.","schema":{"type":"string"}},"CreditsUsed":{"description":"Older header: what this call cost, as whole steps of $0.002. Use x-cost-usd.","schema":{"type":"integer"}},"CostUsd":{"description":"What this call cost, in dollars.","schema":{"type":"string"}},"RateLimitLimit":{"description":"Requests allowed in the current window.","schema":{"type":"integer"}},"RateLimitRemaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimitReset":{"description":"Unix time in seconds when the current window resets.","schema":{"type":"integer"}},"RetryAfter":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}},"IdempotentReplayed":{"description":"true when this call reuses the result of an earlier call with the same Idempotency-Key.","schema":{"type":"string"}},"Cache":{"description":"hit if this result came from the cache, miss if it was fetched live.","schema":{"type":"string"}},"CacheAge":{"description":"Seconds since the returned result was written to the cache.","schema":{"type":"integer"}}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"description":"A value you choose for one call. Send the same key with the same method, path and body within 24 hours and the first answer comes back with idempotent-replayed: true, with the same cost headers and no second charge. A call that sends zeroDataRetention and answers with page data is not kept, so a retry runs again. Needs an API key.","schema":{"type":"string"}},"MaxTextLength":{"name":"maxTextLength","in":"query","required":false,"description":"Cut every text value in the response to this many characters. A value that was cut ends with …, and a page whose text was cut has isTruncated set to true. A screenshot is never cut. Leave it out to get the full text.","schema":{"type":"integer","minimum":1}}},"responses":{"Error":{"description":"The request failed. Retry-After says when trying again can help.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/extract/{id}":{"get":{"operationId":"extractResult","summary":"Read what an extract found. Results are kept for 24 hours.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The extracted data.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"False when status is failed."},"status":{"type":"string","enum":["completed","failed"]},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/extractResult.schema0"}},"confidence":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number","minimum":0,"maximum":1}},"warning":{"description":"The pages that could not be read and why. The fields come from the rest.","type":"string"},"error":{"description":"Why the run failed. Only when status is failed.","type":"string"},"urls":{"type":"array","items":{"type":"string"},"description":"The pages the fields were read from."},"sources":{"description":"For each field, the pages its value came from.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},"creditsUsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"costUsd":{"type":"number","description":"What the run cost, in dollars."},"expiresAt":{"type":"string"},"tokensUsed":{"description":"Tokens used, counted the way v2 clients expect: 15 tokens for each $0.002 spent.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["success","status","data","confidence","urls","creditsUsed","costUsd","expiresAt"],"additionalProperties":false}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/scrape/{id}":{"get":{"operationId":"scrapeResult","summary":"Read a scrape again by its id. Results are kept for 24 hours.","description":"Free. The id is the scrapeId a scrape returned.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The scrape's answer.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","additionalProperties":false,"properties":{"markdown":{"type":"string"},"summary":{"type":"string"},"html":{"type":"string"},"rawHtml":{"type":"string"},"links":{"type":"array","items":{"type":"string"}},"images":{"type":"array","items":{"type":"string"}},"attributes":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"selector":{"type":"string"},"attribute":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":[]}},"screenshot":{"type":"string"},"json":{"$ref":"#/components/schemas/scrape.schema0"},"highlights":{"type":"string"},"isTruncated":{"type":"boolean"},"nextOffset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"changeTracking":{"type":"object","additionalProperties":false,"properties":{"previousScrapeAt":{"type":"string"},"changeStatus":{"type":"string","enum":["new","same","changed"]},"visibility":{"type":"string"},"diff":{"type":"string"}},"required":[]},"branding":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/scrape.schema0"}},"actions":{"type":"object","additionalProperties":false,"properties":{"screenshots":{"type":"array","items":{"type":"string"}},"scrapes":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string"},"html":{"type":"string"}},"required":[]}},"javascriptReturns":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string"},"value":{"$ref":"#/components/schemas/scrape.schema0"}},"required":[]}},"pdfs":{"type":"array","items":{"type":"string"}}},"required":[]},"warning":{"type":"string"},"metadata":{"type":"object","additionalProperties":{},"description":"Facts about the page. Named page facts such as ogTitle or keywords appear when the page has them, and every meta tag also appears under its own name, such as og:title.","properties":{"title":{"type":"string"},"description":{"type":"string"},"language":{"type":"string"},"ogImage":{"type":"string"},"sourceURL":{"type":"string"},"url":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contentType":{"type":"string"},"numPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cacheState":{"type":"string","enum":["hit","miss","stale"]},"cachedAt":{"type":"string"},"scrapeId":{"type":"string"},"costUsd":{"type":"number"}},"required":["statusCode"]}},"required":["isTruncated","metadata"]}},"required":["success","data"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/signup":{"post":{"operationId":"signUp","summary":"Ask your person to approve a Stophy account for you.","description":"Free, and needs no key. Returns a claimUrl for your person and a secret code. Your person signs in with GitHub or Google and approves. A new account starts with $2.00 to spend. Then send the code to POST /v1/signup/poll to collect the key. Each IP address can sign up a few times a day, then the answer is rateLimited with retryAfterSeconds.","security":[{}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}}}}},"responses":{"201":{"description":"The link for your person and your code.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","required":["claimUrl","code","expiresAt"],"properties":{"claimUrl":{"type":"string","description":"The link your person opens to approve the signup."},"code":{"type":"string","description":"Keep it secret. Send it to /v1/signup/poll to collect the key."},"expiresAt":{"type":"string","format":"date-time","description":"When the link and the code stop working. Sign up again after that."}}},"creditsUsed":{"type":"integer","const":0},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/signup/poll":{"post":{"operationId":"pollSignUp","summary":"Collect the key once your person approves.","description":"Free, and needs no key. Answers 202 with status waiting until your person approves, so poll every few seconds. After approval it answers 200 with the key exactly once. A code that is unknown, expired or already collected is notFound: sign up again.","security":[{}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"}}}}}},"responses":{"200":{"description":"Your key. Shown once.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"status":{"const":"waiting","description":"Your person has not approved yet."},"claimUrl":{"type":"string","description":"Give this link to your person."},"apiKey":{"type":"string","description":"The key. Keep it secret. Shown once."}}},"creditsUsed":{"type":"integer","const":0},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"202":{"description":"Your person has not approved yet.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"status":{"const":"waiting","description":"Your person has not approved yet."},"claimUrl":{"type":"string","description":"Give this link to your person."},"apiKey":{"type":"string","description":"The key. Keep it secret. Shown once."}}},"creditsUsed":{"type":"integer","const":0},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/limits":{"get":{"operationId":"getLimits","summary":"See your plan, balance, rate limit and key expiry.","description":"Free. Counts as one call toward the per-minute rate limit. Needs an API key: without one the answer is 401, and the keyless limits are 10 requests a minute and 50 a day per IP.","responses":{"200":{"description":"Your limits.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","required":["tier","balanceCredits","balanceUsd","rateLimit","perMinute","concurrency","jobsAtOnce","queuedJobs","sessionsAtOnce","keyExpiresAt","billingUrl"],"properties":{"tier":{"type":"string","enum":["free","paid"],"description":"paid once the account has topped up, free before that."},"balanceCredits":{"type":"number","description":"Older field: the balance in $0.002 steps."},"balanceUsd":{"type":"number","description":"What is left on the account, in dollars."},"rateLimit":{"type":["object","null"],"description":"Calls allowed per minute with this key and how many are left, counting this request. Null when the counter is unavailable.","properties":{"limitPerMinute":{"type":"integer"},"remaining":{"type":"integer"},"resetsAt":{"type":"string","format":"date-time"}}},"perMinute":{"type":"object","description":"Calls allowed per minute by kind: calls for scrape, search and the rest, jobs for crawl, batch, extract and agent, interact for browser sessions, and reads for polling a job.","properties":{"calls":{"type":"integer"},"jobs":{"type":"integer"},"interact":{"type":"integer"},"reads":{"type":"integer"}}},"concurrency":{"type":"object","description":"Calls that may run at once on this account, and how many run now.","properties":{"limit":{"type":"integer"},"inUse":{"type":["integer","null"],"description":"Null when the counter is unavailable."}}},"jobsAtOnce":{"type":"integer","description":"Crawls, batches and agent runs running at once."},"queuedJobs":{"type":"integer","description":"Jobs that may wait for a place to run."},"sessionsAtOnce":{"type":"integer","description":"Browser sessions open at once."},"paidLimits":{"type":["object","null"],"description":"What a paid account gets, so a free account can see the difference. Null on a paid account.","properties":{"perMinute":{"type":"object","description":"Calls allowed per minute by kind: calls for scrape, search and the rest, jobs for crawl, batch, extract and agent, interact for browser sessions, and reads for polling a job.","properties":{"calls":{"type":"integer"},"jobs":{"type":"integer"},"interact":{"type":"integer"},"reads":{"type":"integer"}}},"concurrency":{"type":"integer","description":"Calls that may run at once."},"jobsAtOnce":{"type":"integer"},"queuedJobs":{"type":"integer"},"sessionsAtOnce":{"type":"integer"}}},"keyExpiresAt":{"type":["string","null"],"format":"date-time","description":"When this key stops working. Null when it does not expire."},"billingUrl":{"type":"string","const":"https://stophy.dev/billing","description":"Where a person adds money."}}},"creditsUsed":{"type":"integer","const":0},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/usage":{"get":{"operationId":"getUsage","summary":"See your balance and what you have used.","description":"Free. balanceMicros is the balance in millionths of a dollar; balanceUsd is the same in dollars.","responses":{"200":{"description":"Your usage.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["balanceMicros","balanceUsd","costUsd","creditsUsed","requestCount"],"properties":{"balanceMicros":{"type":"integer"},"balanceUsd":{"type":"number","description":"The balance, in dollars."},"creditsUsed":{"type":"number","description":"Older field: spent across all calls, in $0.002 steps."},"costUsd":{"type":"number","description":"What all your calls cost, in dollars."},"requestCount":{"type":"integer"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/logs":{"get":{"operationId":"getLogs","summary":"List your recent calls, 50 per page.","description":"Free.","parameters":[{"name":"days","in":"query","description":"How far back to look, 1 to 90.","schema":{"type":"integer","minimum":1,"maximum":90,"default":7}},{"name":"page","in":"query","description":"Page number, from 0.","schema":{"type":"integer","minimum":0,"default":0}},{"name":"apiKeyId","in":"query","description":"Only calls made with this key.","schema":{"type":"string"}},{"name":"endpoint","in":"query","description":"Only calls to this endpoint id, such as reddit.search.","schema":{"type":"string"}}],"responses":{"200":{"description":"Your calls, newest first.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["endpoints","logs","page","pageSize","total","totalPages"],"properties":{"endpoints":{"type":"array","items":{"type":"string"}},"logs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"requestId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"endpoint":{"type":"string"},"method":{"type":"string","description":"Always POST today."},"status":{"type":"integer","description":"Always 200 today."},"response":{"type":"string","description":"Always success today."},"credits":{"type":"number"},"costUsd":{"type":"number","description":"What the call cost, in dollars."},"durationMs":{"type":["integer","null"]},"apiKeyId":{"type":["string","null"]},"apiKeyName":{"type":["string","null"]}}}},"page":{"type":"integer"},"pageSize":{"type":"integer"},"total":{"type":"integer"},"totalPages":{"type":"integer"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/key":{"delete":{"operationId":"revokeKey","summary":"Revoke the key you are calling with.","description":"Free. The key stops working at once. Needs an API key, not a signed-in session.","responses":{"200":{"description":"The key is revoked.","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"const":true}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/team/credit-usage":{"get":{"operationId":"teamCreditUsage","summary":"See the balance left on your account.","description":"Free. There are no plans, so the plan and period fields are null.","responses":{"200":{"description":"Your balance.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"remainingCredits":{"type":"integer"},"balanceUsd":{"type":"number","description":"What is left on the account, in dollars."},"planCredits":{"type":"null"},"billingPeriodStart":{"type":"null"},"billingPeriodEnd":{"type":"null"}}},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/team/credit-usage/historical":{"get":{"operationId":"teamCreditUsageHistorical","summary":"See what you spent each month.","description":"Free.","parameters":[{"name":"byApiKey","in":"query","required":false,"description":"Split each month by the key that made the calls.","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Spending by month.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"periods":{"type":"array","items":{"type":"object","properties":{"startDate":{"type":"string","format":"date"},"endDate":{"type":"string","format":"date"},"apiKey":{"type":["string","null"],"description":"The key's name. Sent with byApiKey."},"totalCredits":{"type":"number"},"creditsUsed":{"type":"number"},"totalCostUsd":{"type":"number"},"costUsd":{"type":"number"}}}},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/team/token-usage":{"get":{"operationId":"teamTokenUsage","summary":"See the model use this month.","description":"Free. Tokens here are 15 for each $0.002 that extract and agent cost.","responses":{"200":{"description":"This month's model use.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"remainingTokens":{"type":"integer"},"planTokens":{"type":"null"},"billingPeriodStart":{"type":"null"},"billingPeriodEnd":{"type":"null"},"tokensUsed":{"type":"number"},"usedSince":{"type":"string","format":"date-time"},"byEndpoint":{"type":"object","additionalProperties":{"type":"number"}}}},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/team/token-usage/historical":{"get":{"operationId":"teamTokenUsageHistorical","summary":"See the model use each month.","description":"Free.","parameters":[{"name":"byApiKey","in":"query","required":false,"description":"Split each month by the key that made the calls.","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Model use by month.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"periods":{"type":"array","items":{"type":"object","properties":{"startDate":{"type":"string","format":"date"},"endDate":{"type":"string","format":"date"},"apiKey":{"type":["string","null"],"description":"The key's name. Sent with byApiKey."},"totalTokens":{"type":"number"},"tokensUsed":{"type":"number"}}}},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/team/queue-status":{"get":{"operationId":"teamQueueStatus","summary":"See your crawl, batch and agent jobs that are running or waiting.","description":"Free.","responses":{"200":{"description":"Your queue.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"activeJobsInQueue":{"type":"integer"},"waitingJobsInQueue":{"type":"integer"},"jobsInQueue":{"type":"integer"},"maxConcurrency":{"type":"integer","description":"Jobs that can run at once."},"mostRecentSuccess":{"type":["string","null"],"format":"date-time"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/team/activity":{"get":{"operationId":"teamActivity","summary":"List your recent billed calls, newest first.","description":"Free. Pages with cursor.","parameters":[{"name":"endpoint","in":"query","required":false,"description":"Only calls to this endpoint, such as scrape.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Calls per page.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","required":false,"description":"The cursor the last page returned.","schema":{"type":"string"}}],"responses":{"200":{"description":"Your calls.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"endpoint":{"type":"string"},"api_version":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"target":{"type":"null"}}}},"cursor":{"type":["string","null"]},"has_more":{"type":"boolean"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/concurrency-check":{"get":{"operationId":"concurrencyCheck","summary":"See how many calls you have running and how many can run at once.","description":"Free.","responses":{"200":{"description":"Your calls at once.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"concurrency":{"type":"integer"},"maxConcurrency":{"type":"integer"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/keyless/eligibility":{"get":{"operationId":"keylessEligibility","summary":"See whether calls without a key are still allowed from your address.","description":"Free, and needs no key.","security":[{}],"responses":{"200":{"description":"What is left without a key.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"eligible":{"type":"boolean"},"remainingToday":{"type":"integer"},"remainingThisMinute":{"type":"integer"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/feedback":{"post":{"operationId":"feedback","summary":"Rate the answer of an earlier call.","description":"Free. A bad rating refunds what that call cost, up to a daily cap. Send the call's requestId as jobId.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rating":{"type":"string","enum":["good","partial","bad"]},"valuableSources":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"reason":{"type":"string","maxLength":1000}},"required":["url"]}},"valuableResults":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["web","images","news"]},"position":{"type":"integer","minimum":1,"maximum":100},"reason":{"type":"string","maxLength":1000}},"required":["source","position"]}},"missingContent":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"topic":{"type":"string","minLength":1,"maxLength":200}},"additionalProperties":{}}},"querySuggestions":{"type":"string","maxLength":2000},"origin":{"default":"api","type":"string","maxLength":80},"integration":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"endpoint":{"type":"string","enum":["search","scrape","parse","map"]},"jobId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,100}$"},"issues":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":80,"pattern":"^[a-z0-9][a-z0-9_-]*$"}},"tags":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":80,"pattern":"^[a-z0-9][a-z0-9_-]*$"}},"note":{"type":"string","maxLength":4000},"url":{"type":"string","format":"uri"},"pageNumbers":{"maxItems":100,"type":"array","items":{"type":"integer","minimum":1,"maximum":9007199254740991}},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["rating","jobId"]}}}},"responses":{"200":{"description":"Your feedback was saved.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"feedbackId":{"type":"string"},"creditsRefunded":{"type":"number"},"refundedUsd":{"type":"number","description":"What was refunded, in dollars."},"alreadySubmitted":{"type":"boolean"},"dailyCapReached":{"type":"boolean"},"creditsRefundedToday":{"type":"number"},"refundedTodayUsd":{"type":"number","description":"What was refunded today, in dollars."},"dailyRefundCap":{"type":"number"},"dailyRefundCapUsd":{"type":"number","description":"The most refunded in a day, in dollars."},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/search/{jobId}/feedback":{"post":{"operationId":"searchFeedback","summary":"Rate the answer of an earlier search.","description":"Free. A bad rating refunds what that search cost, up to a daily cap. jobId is the search's requestId.","parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rating":{"type":"string","enum":["good","partial","bad"]},"valuableSources":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"reason":{"type":"string","maxLength":1000}},"required":["url"]}},"valuableResults":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["web","images","news"]},"position":{"type":"integer","minimum":1,"maximum":100},"reason":{"type":"string","maxLength":1000}},"required":["source","position"]}},"missingContent":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"topic":{"type":"string","minLength":1,"maxLength":200}},"additionalProperties":{}}},"querySuggestions":{"type":"string","maxLength":2000},"origin":{"default":"api","type":"string","maxLength":80},"integration":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]}},"required":["rating"]}}}},"responses":{"200":{"description":"Your feedback was saved.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"feedbackId":{"type":"string"},"creditsRefunded":{"type":"number"},"refundedUsd":{"type":"number","description":"What was refunded, in dollars."},"alreadySubmitted":{"type":"boolean"},"dailyCapReached":{"type":"boolean"},"creditsRefundedToday":{"type":"number"},"refundedTodayUsd":{"type":"number","description":"What was refunded today, in dollars."},"dailyRefundCap":{"type":"number"},"dailyRefundCapUsd":{"type":"number","description":"The most refunded in a day, in dollars."},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/parsers":{"get":{"operationId":"listParsers","summary":"List the parsers: the sites scrape can return as JSON, the page each one reads, what it returns and what it costs.","security":[{}],"responses":{"200":{"description":"The parsers.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"parsers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"takes":{"type":"string"},"example":{"type":"string"},"options":{"type":"array","items":{"type":"object"}},"returns":{"type":"array","items":{"type":"string"}},"price":{"type":"string"},"credits":{"type":"integer"},"keyless":{"type":"boolean"}}}}}}}}}}}}}},"/v1/endpoints":{"get":{"operationId":"listEndpoints","summary":"List the endpoints with their prices, input schemas and examples.","description":"Free, and needs no key.","security":[{}],"responses":{"200":{"description":"The endpoints and the sources they read.","content":{"application/json":{"schema":{"type":"object","properties":{"sources":{"readOnly":true,"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"summary":{"type":"string"},"kind":{"type":"string","enum":["site","aiAnswers"]}},"required":["id","name","summary","kind"]}},"endpoints":{"readOnly":true,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9]+(?:\\.[a-zA-Z0-9-]+)*$"},"title":{"type":"string"},"summary":{"type":"string"},"bestWhen":{"anyOf":[{"type":"string"},{"type":"null"}]},"method":{"type":"string","const":"POST"},"path":{"type":"string","pattern":"^\\/v1\\/.*"},"credits":{"type":"integer","minimum":0,"maximum":9007199254740991},"maxCredits":{"type":"integer","minimum":0,"maximum":9007199254740991},"costUsd":{"type":"number","minimum":0},"maxCostUsd":{"type":"number","minimum":0},"pricing":{"anyOf":[{"type":"string"},{"type":"null"}]},"keyless":{"type":"boolean"},"cacheTtlSeconds":{"type":"integer","minimum":0,"maximum":9007199254740991},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/listEndpoints.26.schema0"}},"example":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/listEndpoints.26.schema0"}},{"type":"null"}]}},"required":["id","title","summary","bestWhen","method","path","credits","maxCredits","pricing","keyless","cacheTtlSeconds","input","example"]}}},"required":["sources","endpoints"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/status":{"get":{"operationId":"siteStatus","summary":"See which sources passed their last checks.","description":"Free, and needs no key.","security":[{}],"responses":{"200":{"description":"Each source's last checks.","content":{"application/json":{"schema":{"type":"object","properties":{"sources":{"type":"array","items":{"type":"object","properties":{"failing":{"type":"array","items":{"type":"string"}},"id":{"type":"string"},"lastCheckAt":{"type":"string"},"medianMs":{"type":"number"},"name":{"type":"string"},"passed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"state":{"type":"string","enum":["up","partial","down"]},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["failing","id","lastCheckAt","medianMs","name","passed","state","total"]}},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["sources","updatedAt"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/parse/formats":{"get":{"operationId":"parseFormats","summary":"List the file formats parse reads.","description":"Free.","responses":{"200":{"description":"The formats.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","properties":{"formats":{"type":"array","items":{"type":"object","properties":{"format":{"type":"string"},"kind":{"type":"string","enum":["document","image"]},"extensions":{"type":"array","items":{"type":"string"}},"mimeTypes":{"type":"array","items":{"type":"string"}},"available":{"type":"boolean"}}}}}}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/parse/upload-url":{"post":{"operationId":"parseUploadUrl","summary":"Get an address to upload a large file to, for parse.","description":"Free. PUT the file to uploadUrl within 15 minutes, then send uploadId to POST /v1/parse as uploadRef.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"contentType":{"type":"string","minLength":1,"maxLength":200},"declaredSizeBytes":{"type":"integer","minimum":1,"maximum":37748736},"origin":{"type":"string","maxLength":200},"integration":{"type":"string","maxLength":200}}}}}},"responses":{"200":{"description":"Where to upload the file.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"uploadId":{"type":"string"},"uploadRef":{"type":"string","description":"The same as uploadId."},"uploadUrl":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"maxBytes":{"type":"integer"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/crawl/active":{"get":{"operationId":"crawlActive","summary":"List your crawls that are running or waiting.","description":"Free.","responses":{"200":{"description":"Your crawls.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"crawls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"teamId":{"type":"string"},"url":{"type":"string"},"status":{"type":"string","enum":["queued","scraping"]},"createdAt":{"type":"string","format":"date-time"},"options":{"type":"object"}}}},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/browser/network-policies":{"post":{"operationId":"browserNetworkPolicyCreate","summary":"Save a network policy that allows or blocks domains for browser sessions.","description":"Free. A domain such as example.com covers itself and every subdomain, and the most specific entry wins. A domain no entry matches gets defaultAction, allow when you leave it out. For an allowlist send defaultAction block and the domains in allow. Domains are trimmed, lower-cased, converted to punycode and de-duplicated, and a leading *. is dropped. URLs, paths, ports, IP addresses, other wildcards and a domain in both lists answer 400. A policy holds at most 10,000 domains in allow and block together, and an account at most 100 policies. Send the id as networkPolicyId when you open a session.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"defaultAction":{"default":"allow","type":"string","enum":["allow","block"]},"allow":{"type":"object","properties":{"domains":{"maxItems":10000,"type":"array","items":{"type":"string"}}},"required":["domains"],"additionalProperties":false},"block":{"type":"object","properties":{"domains":{"maxItems":10000,"type":"array","items":{"type":"string"}}},"required":["domains"],"additionalProperties":false}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"The policy.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"defaultAction":{"type":"string","enum":["allow","block"],"description":"What happens to a domain that no list entry matches."},"allow":{"type":"object","properties":{"domains":{"type":"array","items":{"type":"string"},"maxItems":10000}}},"block":{"type":"object","properties":{"domains":{"type":"array","items":{"type":"string"},"maxItems":10000}}},"version":{"type":"integer","description":"Starts at 1 and goes up by 1 with each update."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"browserNetworkPolicyList","summary":"List your network policies.","description":"Free. Newest first.","parameters":[{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},{"name":"pageNumber","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1}}],"responses":{"200":{"description":"Your policies.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"defaultAction":{"type":"string","enum":["allow","block"],"description":"What happens to a domain that no list entry matches."},"allow":{"type":"object","properties":{"domains":{"type":"array","items":{"type":"string"},"maxItems":10000}}},"block":{"type":"object","properties":{"domains":{"type":"array","items":{"type":"string"},"maxItems":10000}}},"version":{"type":"integer","description":"Starts at 1 and goes up by 1 with each update."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"totalItems":{"type":"integer"},"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/browser/network-policies/{policy_id}":{"get":{"operationId":"browserNetworkPolicyGet","summary":"See one network policy.","description":"Free.","parameters":[{"name":"policy_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The policy.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"defaultAction":{"type":"string","enum":["allow","block"],"description":"What happens to a domain that no list entry matches."},"allow":{"type":"object","properties":{"domains":{"type":"array","items":{"type":"string"},"maxItems":10000}}},"block":{"type":"object","properties":{"domains":{"type":"array","items":{"type":"string"},"maxItems":10000}}},"version":{"type":"integer","description":"Starts at 1 and goes up by 1 with each update."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"browserNetworkPolicyUpdate","summary":"Change a network policy, and every running session that uses it.","description":"Free. Each field you send replaces the old one, and a list replaces the whole list. The version goes up by 1. Running sessions that use the policy pick the change up before this call answers, and they close their open connections to hosts the change now blocks. A session this call could not reach is listed in pendingSessionIds, and the change is retried every few seconds until it reaches it. A session shows the version it enforces in networkPolicyVersion. Answers 404 for an unknown policy and 400 for a bad body.","parameters":[{"name":"policy_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"defaultAction":{"type":"string","enum":["allow","block"]},"allow":{"type":"object","properties":{"domains":{"maxItems":10000,"type":"array","items":{"type":"string"}}},"required":["domains"],"additionalProperties":false},"block":{"type":"object","properties":{"domains":{"maxItems":10000,"type":"array","items":{"type":"string"}}},"required":["domains"],"additionalProperties":false}},"additionalProperties":false}}}},"responses":{"200":{"description":"The policy.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"defaultAction":{"type":"string","enum":["allow","block"],"description":"What happens to a domain that no list entry matches."},"allow":{"type":"object","properties":{"domains":{"type":"array","items":{"type":"string"},"maxItems":10000}}},"block":{"type":"object","properties":{"domains":{"type":"array","items":{"type":"string"},"maxItems":10000}}},"version":{"type":"integer","description":"Starts at 1 and goes up by 1 with each update."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"runningSessions":{"type":"integer","description":"Running browser sessions that use the policy, applied or pending."},"appliedSessions":{"type":"integer","description":"How many of them now enforce this version. A session that is still on an older version shows that in networkPolicyVersion."},"pendingSessionIds":{"type":"array","items":{"type":"string"},"description":"Sessions this call could not reach yet. They still enforce an older version."},"closedConnections":{"type":"integer","description":"Open connections to hosts the new version blocks, closed in those sessions."},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"browserNetworkPolicyDelete","summary":"Delete a network policy.","description":"Free. Answers 409 with the number of running sessions while any session still uses the policy, so a session never loses its rules. Close them or wait for them to end first.","parameters":[{"name":"policy_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The policy is deleted.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/browser/{session_id}/recording":{"get":{"operationId":"browserRecording","summary":"See the video of a recorded browser session.","description":"Free. Every session is recorded unless it was created with recording false or zeroDataRetention. The video covers every tab the session showed, as an MP4. It is made after the session stops, and processing usually takes a few minutes. A ready video is kept 7 days, or until you delete it. Answers 404 when the session was not recorded.","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The recording.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"recordingStatus":{"type":"string","enum":["none","recording","processing","ready","failed"],"description":"none: the session was not recorded, or its video was deleted. recording: the session is running. processing: the session stopped and the video is being made, usually within a few minutes, or the status could not be read yet, so read it again. ready: recordingUrl works. failed: the video was never made and cannot be any more. A ready video is kept 7 days."},"recordingAvailable":{"type":"boolean","description":"false when recordingStatus is none or failed, true while a video is or will be there."},"recordingTruncated":{"type":"boolean","description":"true when the video ends early because the session showed more than a recording can hold."},"recordingUrl":{"type":"string","description":"The MP4, with no key needed, for 15 minutes. It plays and seeks in a browser or player. Sent when recordingStatus is ready. Read the session again for a new link."},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"browserRecordingDelete","summary":"Delete the video of a browser session.","description":"Free. Deletes the timeline too. Answers 409 while the video is still being made, and 404 when there is none.","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The video is deleted.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"recordingStatus":{"type":"string","enum":["none","recording","processing","ready","failed"],"description":"none: the session was not recorded, or its video was deleted. recording: the session is running. processing: the session stopped and the video is being made, usually within a few minutes, or the status could not be read yet, so read it again. ready: recordingUrl works. failed: the video was never made and cannot be any more. A ready video is kept 7 days."},"recordingAvailable":{"type":"boolean","description":"false when recordingStatus is none or failed, true while a video is or will be there."},"recordingTruncated":{"type":"boolean","description":"true when the video ends early because the session showed more than a recording can hold."},"recordingUrl":{"type":"string","description":"The MP4, with no key needed, for 15 minutes. It plays and seeks in a browser or player. Sent when recordingStatus is ready. Read the session again for a new link."},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/browser/{session_id}/recording/timeline":{"get":{"operationId":"browserRecordingTimeline","summary":"See what a recorded session did, in step with its video.","description":"Free. The session's steps (code calls, clicks, keys, scrolls, downloads, dialogs; typed text is counted, never kept), page loads per tab, the browser's console messages (page console output only with captureConsole) and network requests, each stamped at in epoch milliseconds. The video's first frame is at videoStartedAt, so an event plays at (at - videoStartedAt) / 1000 seconds. dropped counts events past the per-kind limits. Ready when the session stops, kept with the video for 7 days. Answers 409 while the session runs, 503 for a few seconds after it stops, and 404 when the session was not recorded or was recorded before timelines existed.","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The timeline.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"videoStartedAt":{"type":"integer"},"events":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"step"},"at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"text":{"type":"string"}},"required":["kind","at","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"page"},"at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tab":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"}},"required":["kind","at","tab","url"]},{"type":"object","properties":{"kind":{"type":"string","const":"console"},"at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"level":{"type":"string","enum":["error","warning","info","log","debug"]},"text":{"type":"string"},"url":{"type":"string"},"repeats":{"type":"integer","minimum":2,"maximum":9007199254740991}},"required":["kind","at","level","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"request"},"at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tab":{"type":"integer","minimum":0,"maximum":9007199254740991},"method":{"type":"string"},"url":{"type":"string"},"type":{"type":"string"},"status":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991},"error":{"type":"string"}},"required":["kind","at","method","url","type","status","ms"]}]}},"dropped":{"type":"integer"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/browser/extensions":{"post":{"operationId":"browserExtensionUpload","summary":"Upload a Chrome extension for browser sessions.","description":"Free. A zip of up to 50 MiB with manifest.json at its root, Manifest V3 only. Refused with prohibitedPermission when manifest.json has a key field or asks for the debugger, proxy, processes, dns, experimental or enterprise.* permissions. You can keep 100. There is no update: upload again for a new id. Open a browser with up to 3 of them in extensionIds. Loading an extension changes what sites can see, so only browsers opened with extensionIds have one.","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"201":{"description":"The extension.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"id":{"type":"string","format":"uuid","description":"Send it in extensionIds when you open a browser."},"name":{"type":"string"},"version":{"type":"string","description":"The version in manifest.json."},"createdAt":{"type":"string","format":"date-time"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"browserExtensionList","summary":"List the extensions you uploaded.","description":"Free. Newest first.","parameters":[{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},{"name":"pageNumber","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1}}],"responses":{"200":{"description":"Your extensions.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Send it in extensionIds when you open a browser."},"name":{"type":"string"},"version":{"type":"string","description":"The version in manifest.json."},"createdAt":{"type":"string","format":"date-time"}}}},"totalItems":{"type":"integer"},"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/browser/extensions/{extension_id}":{"get":{"operationId":"browserExtensionGet","summary":"See one extension you uploaded.","description":"Free.","parameters":[{"name":"extension_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The extension.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"id":{"type":"string","format":"uuid","description":"Send it in extensionIds when you open a browser."},"name":{"type":"string"},"version":{"type":"string","description":"The version in manifest.json."},"createdAt":{"type":"string","format":"date-time"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"browserExtensionDelete","summary":"Delete an extension.","description":"Free. Browsers that are already open keep it until they close. New browsers cannot use the id.","parameters":[{"name":"extension_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The extension is deleted.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/browser":{"post":{"operationId":"browserCreate","summary":"Open a cloud browser session.","description":"$0.06 per hour open, or $0.84 per hour for the whole session once a prompt has run. You pay when the session closes. Code-only time rounds up to 2-minute blocks. Prompted time has a one-minute minimum and the charge rounds up in $0.002 increments. Traffic adds $5 per GB on the default network, rounded up in 400 kB blocks, or $0.20 per GB direct or through your own proxy, rounded up in 10 MB blocks. ttl is the most it can live, activityTtl how long it waits with no call before it closes.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey","description":"Use the same key and create options on the same account to recover a running session without another hold. The key also works on POST /v1/interact and lasts 24 hours after the session opens. A different body or an ended session returns 409. Use a new key to open another session. If you get 503 with Retry-After, retry with the same key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ttl":{"default":600,"type":"integer","minimum":30,"maximum":21600},"activityTtl":{"default":300,"type":"integer","minimum":10,"maximum":21600},"streamWebView":{"type":"boolean"},"zeroDataRetention":{"type":"boolean"},"blockAds":{"type":"boolean"},"solveCaptchas":{"type":"boolean"},"captureConsole":{"type":"boolean"},"screen":{"description":"Screen size in pixels, width 500 to 6144 and height 320 to 3456. The browser window fills it, and sites read it as the display. Default 1920x1080. Leave it out unless you need it.","type":"object","properties":{"width":{"type":"integer","minimum":500,"maximum":6144},"height":{"type":"integer","minimum":320,"maximum":3456}},"required":["width","height"],"additionalProperties":false},"allowResizing":{"description":"false keeps the window at its size: setViewportSize and CDP resize commands are accepted and change nothing. Leave it out to allow resizing.","type":"boolean"},"pdfRenderer":{"description":"Left out or true, a PDF opens in the browser's own viewer, as in any Chrome. false saves each PDF as a download instead, which also hides Chrome's PDF plugins from pages.","type":"boolean"},"recording":{"description":"Left out or true, the session is recorded: an MP4 of every tab it shows, and a timeline of its steps, page loads, console and network beside it. Free. The video is made after the session stops and both are kept 7 days. Read recordingStatus on the session, then GET /v1/browser/{id}/replay. false records nothing. A zeroDataRetention session is never recorded.","type":"boolean"},"metadata":{"description":"Up to 10 pairs of text, keys up to 100 characters and values up to 1000. Sent back with the session, and list can filter on them.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":1000}},"extensionIds":{"description":"Up to 3 ids of extensions you uploaded with POST /v1/browser/extensions. They load before the first page opens and cannot change while the session runs. Leave it out for a plain browser: loading an extension changes what sites can see.","maxItems":3,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"allowedDomains":{"maxItems":100,"type":"array","items":{"type":"string","pattern":"^(?:\\*\\.)?[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$"}},"networkPolicyId":{"description":"A saved network policy from POST /v1/browser/network-policies. Its rules apply to every request the session makes, and a change to the policy reaches the running session within seconds. Not with allowedDomains.","type":"string","minLength":1,"maxLength":100},"proxy":{"description":"residential is the default network, and the only one location.country applies to. direct uses no proxy. Or send your own proxy URL.","anyOf":[{"type":"string","const":"residential"},{"type":"string","const":"direct"},{"type":"string"}]},"profile":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"saveChanges":{"default":true,"type":"boolean"}},"required":["name"],"additionalProperties":false},"location":{"type":"object","properties":{"country":{"type":"string"}},"additionalProperties":false}}}}}},"responses":{"200":{"description":"The session.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"idempotent-replayed":{"$ref":"#/components/headers/IdempotentReplayed"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"id":{"type":"string"},"status":{"type":"string","enum":["active","destroyed"]},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":"string","format":"date-time","description":"When the session opened."},"finishedAt":{"type":["string","null"],"format":"date-time","description":"When the session ended. Null while it runs."},"timeoutAt":{"type":"string","format":"date-time","description":"When the session stops by itself if nothing else happens: the earlier of expiresAt and the idle limit after the last call, which moves forward with each call. After the session ends it is finishedAt."},"lastActivity":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"metadata":{"type":"object","additionalProperties":{"type":"string"},"description":"The pairs sent when the session opened."},"networkPolicyId":{"type":["string","null"],"description":"The network policy the session was opened with. Null for none."},"networkPolicyVersion":{"type":["integer","null"],"description":"The version of that policy the session enforces now. It goes up when a change to the policy reaches the session, so a session behind the policy's version has not received the change yet."},"proxyUsedMb":{"type":["number","null"],"description":"Traffic through all networks, in MB. Null until the session closes."},"browserCredits":{"type":["integer","null"],"description":"Older field: the browser time in $0.002 steps. Null until the session closes."},"browserCostUsd":{"type":["number","null"],"description":"What the time the session was open cost, in dollars. Null until it closes."},"proxyCredits":{"type":["integer","null"],"description":"Older field: the traffic in $0.002 steps. Null until the session closes."},"proxyCostUsd":{"type":["number","null"],"description":"What the traffic cost, in dollars. Null until the session closes."},"cdpUrl":{"type":"string","description":"Connect a CDP client such as Playwright here."},"liveViewUrl":{"type":"string","description":"Watch the session. Sent with streamWebView."},"interactiveLiveViewUrl":{"type":"string","description":"Watch and control the session. Sent with streamWebView."},"streamWebView":{"type":"boolean"},"extensions":{"type":"array","description":"The extensions loaded in the session, in the order of extensionIds.","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"runtimeId":{"type":"string","description":"Chrome's id for it, as in chrome-extension://{runtimeId}/."},"version":{"type":"string"}}}},"recordingStatus":{"type":"string","enum":["none","recording","processing","ready","failed"],"description":"none: the session was not recorded, or its video was deleted. recording: the session is running. processing: the session stopped and the video is being made, usually within a few minutes, or the status could not be read yet, so read it again. ready: recordingUrl works. failed: the video was never made and cannot be any more. A ready video is kept 7 days."},"recordingAvailable":{"type":"boolean","description":"false when recordingStatus is none or failed, true while a video is or will be there."},"recordingTruncated":{"type":"boolean","description":"true when the video ends early because the session showed more than a recording can hold."},"recordingUrl":{"type":"string","description":"The MP4, with no key needed, for 15 minutes. It plays and seeks in a browser or player. Sent when recordingStatus is ready. Read the session again for a new link."},"warning":{"type":"string"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"browserList","summary":"List your browser sessions.","description":"Free. Newest first. Send nextCursor as cursor to get the next page. metadata is key to match any value, or key=value to match one, and sending it again narrows the list further.","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","destroyed"]}},{"name":"metadata","in":"query","required":false,"explode":true,"schema":{"type":"array","items":{"type":"string"},"maxItems":10}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Your sessions.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"sessions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["active","destroyed"]},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":"string","format":"date-time","description":"When the session opened."},"finishedAt":{"type":["string","null"],"format":"date-time","description":"When the session ended. Null while it runs."},"timeoutAt":{"type":"string","format":"date-time","description":"When the session stops by itself if nothing else happens: the earlier of expiresAt and the idle limit after the last call, which moves forward with each call. After the session ends it is finishedAt."},"lastActivity":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"metadata":{"type":"object","additionalProperties":{"type":"string"},"description":"The pairs sent when the session opened."},"networkPolicyId":{"type":["string","null"],"description":"The network policy the session was opened with. Null for none."},"networkPolicyVersion":{"type":["integer","null"],"description":"The version of that policy the session enforces now. It goes up when a change to the policy reaches the session, so a session behind the policy's version has not received the change yet."},"proxyUsedMb":{"type":["number","null"],"description":"Traffic through all networks, in MB. Null until the session closes."},"browserCredits":{"type":["integer","null"],"description":"Older field: the browser time in $0.002 steps. Null until the session closes."},"browserCostUsd":{"type":["number","null"],"description":"What the time the session was open cost, in dollars. Null until it closes."},"proxyCredits":{"type":["integer","null"],"description":"Older field: the traffic in $0.002 steps. Null until the session closes."},"proxyCostUsd":{"type":["number","null"],"description":"What the traffic cost, in dollars. Null until the session closes."},"cdpUrl":{"type":"string","description":"Connect a CDP client such as Playwright here."},"liveViewUrl":{"type":"string","description":"Watch the session. Sent with streamWebView."},"interactiveLiveViewUrl":{"type":"string","description":"Watch and control the session. Sent with streamWebView."},"streamWebView":{"type":"boolean"},"extensions":{"type":"array","description":"The extensions loaded in the session, in the order of extensionIds.","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"runtimeId":{"type":"string","description":"Chrome's id for it, as in chrome-extension://{runtimeId}/."},"version":{"type":"string"}}}}}}},"nextCursor":{"type":["string","null"]},"hasMore":{"type":"boolean"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/browser/{session_id}":{"get":{"operationId":"browserGet","summary":"See one browser session, with its downloads and uploads.","description":"Free.","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The session.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"id":{"type":"string"},"status":{"type":"string","enum":["active","destroyed"]},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":"string","format":"date-time","description":"When the session opened."},"finishedAt":{"type":["string","null"],"format":"date-time","description":"When the session ended. Null while it runs."},"timeoutAt":{"type":"string","format":"date-time","description":"When the session stops by itself if nothing else happens: the earlier of expiresAt and the idle limit after the last call, which moves forward with each call. After the session ends it is finishedAt."},"lastActivity":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"metadata":{"type":"object","additionalProperties":{"type":"string"},"description":"The pairs sent when the session opened."},"networkPolicyId":{"type":["string","null"],"description":"The network policy the session was opened with. Null for none."},"networkPolicyVersion":{"type":["integer","null"],"description":"The version of that policy the session enforces now. It goes up when a change to the policy reaches the session, so a session behind the policy's version has not received the change yet."},"proxyUsedMb":{"type":["number","null"],"description":"Traffic through all networks, in MB. Null until the session closes."},"browserCredits":{"type":["integer","null"],"description":"Older field: the browser time in $0.002 steps. Null until the session closes."},"browserCostUsd":{"type":["number","null"],"description":"What the time the session was open cost, in dollars. Null until it closes."},"proxyCredits":{"type":["integer","null"],"description":"Older field: the traffic in $0.002 steps. Null until the session closes."},"proxyCostUsd":{"type":["number","null"],"description":"What the traffic cost, in dollars. Null until the session closes."},"cdpUrl":{"type":"string","description":"Connect a CDP client such as Playwright here."},"liveViewUrl":{"type":"string","description":"Watch the session. Sent with streamWebView."},"interactiveLiveViewUrl":{"type":"string","description":"Watch and control the session. Sent with streamWebView."},"streamWebView":{"type":"boolean"},"extensions":{"type":"array","description":"The extensions loaded in the session, in the order of extensionIds.","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"runtimeId":{"type":"string","description":"Chrome's id for it, as in chrome-extension://{runtimeId}/."},"version":{"type":"string"}}}},"recordingStatus":{"type":"string","enum":["none","recording","processing","ready","failed"],"description":"none: the session was not recorded, or its video was deleted. recording: the session is running. processing: the session stopped and the video is being made, usually within a few minutes, or the status could not be read yet, so read it again. ready: recordingUrl works. failed: the video was never made and cannot be any more. A ready video is kept 7 days."},"recordingAvailable":{"type":"boolean","description":"false when recordingStatus is none or failed, true while a video is or will be there."},"recordingTruncated":{"type":"boolean","description":"true when the video ends early because the session showed more than a recording can hold."},"recordingUrl":{"type":"string","description":"The MP4, with no key needed, for 15 minutes. It plays and seeks in a browser or player. Sent when recordingStatus is ready. Read the session again for a new link."},"reason":{"type":"string","description":"Why the session ended."},"downloads":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"size":{"type":"integer"}}}},"uploads":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"size":{"type":"integer"}}}},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"browserDelete","summary":"Close a browser session and bill the time it was open.","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The session is closed.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"recordingStatus":{"type":"string","enum":["none","recording","processing","ready","failed"],"description":"none: the session was not recorded, or its video was deleted. recording: the session is running. processing: the session stopped and the video is being made, usually within a few minutes, or the status could not be read yet, so read it again. ready: recordingUrl works. failed: the video was never made and cannot be any more. A ready video is kept 7 days."},"sessionDurationMs":{"type":"integer"},"proxyBytes":{"type":"integer"},"exitBytes":{"type":"object","description":"Traffic by kind of network. Each kind is billed at its own rate.","properties":{"managed":{"type":"integer"},"direct":{"type":"integer"},"custom":{"type":"integer"}}},"creditsBilled":{"type":"integer"},"sessionCostUsd":{"type":"number","description":"Present when the session was billed before this call. costUsd is then zero and this is the earlier charge in dollars."},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/browser/{session_id}/proxy":{"get":{"operationId":"browserProxyGet","summary":"See how an open browser session reaches the web.","description":"Free.","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"How the session reaches the web.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"mode":{"type":"string","enum":["managed","direct","custom"],"description":"managed is the default network, direct has no proxy, custom is your own."},"country":{"type":["string","null"],"description":"The country a managed session appears in."},"exitIp":{"type":["string","null"],"description":"The address sites see. Null for your own proxy, and null with exitIpError when the address could not be read."},"exitIpError":{"type":"string","description":"Present when exitIp is null because the address could not be read. Send the request again."},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"browserProxyUpdate","summary":"Change how an open browser session reaches the web, with its tabs and logins kept.","description":"Free. Send mode managed with a country, or rotate true for a new address in the current country, mode direct for no proxy, or mode custom with customProxy. Sending nothing to change answers as GET does. Connections open now end, and new ones use the new network. Traffic before and after the change is billed at the rate of its own network. Answers 409 when the session is not running.","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"description":"managed is the default network, direct uses none, custom takes customProxy.","type":"string","enum":["managed","direct","custom"]},"country":{"description":"managed: the country to appear in, such as DE.","type":"string"},"rotate":{"description":"true gets a new address in the current country.","type":"boolean"},"customProxy":{"description":"Your own proxy, with mode custom.","type":"object","properties":{"host":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$"},"port":{"type":"integer","minimum":1,"maximum":65535},"username":{"type":"string","minLength":1,"maxLength":2048},"password":{"type":"string","minLength":1,"maxLength":8192},"protocol":{"type":"string","enum":["http","https","socks5","socks5h"]}},"required":["host","port"],"additionalProperties":false}},"additionalProperties":false}}}},"responses":{"200":{"description":"How the session reaches the web now.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"mode":{"type":"string","enum":["managed","direct","custom"],"description":"managed is the default network, direct has no proxy, custom is your own."},"country":{"type":["string","null"],"description":"The country a managed session appears in."},"exitIp":{"type":["string","null"],"description":"The address sites see. Null for your own proxy, and null with exitIpError when the address could not be read."},"exitIpError":{"type":"string","description":"Present when exitIp is null because the address could not be read. Send the request again."},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/browser/{session_id}/downloads":{"get":{"operationId":"browserDownloads","summary":"List the files an open browser session downloaded.","description":"Free. Sorted by name. Send nextCursor as cursor for the next page. includeUrls true adds a url for each file up to 100 MB that works for 15 minutes with no key. The files are removed when the session closes, so fetch them first. Answers 409 when the session is not running.","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"includeUrls","in":"query","required":false,"schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"The files.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"files":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"size":{"type":"integer"},"contentType":{"type":"string","description":"Guessed from the file name."},"url":{"type":"string","description":"Sent with includeUrls, for files up to 10 MB."}}}},"nextCursor":{"type":["string","null"]},"hasMore":{"type":"boolean"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/browser/{session_id}/execute":{"post":{"operationId":"browserExecute","summary":"Run code or a prompt in an open browser session.","description":"Send code or a prompt. timeout is in seconds, up to 300, and the session's own end still stops the run.","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":200000},"prompt":{"type":"string","minLength":1,"maxLength":10000},"language":{"default":"node","type":"string","enum":["node","python","bash"]},"timeout":{"type":"integer","minimum":1,"maximum":300}}}}}},"responses":{"200":{"description":"What the run printed and returned.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"output":{"type":"string","description":"What the code printed."},"stdout":{"type":"string"},"result":{"type":"string","description":"The value the code returned, as text."},"stderr":{"type":"string"},"exitCode":{"type":"integer"},"killed":{"type":"boolean","description":"true when the code ran out of time."},"truncated":{"type":"boolean","description":"True when standard output contains a notice that it was cut. A large returned result can be dropped without setting this flag."},"error":{"type":"string"},"steps":{"type":"array","items":{"type":"string"}},"page":{"type":"object","properties":{"url":{"type":"string"},"title":{"type":"string"}}},"cdpUrl":{"type":"string","description":"Connect a CDP client such as Playwright here."},"liveViewUrl":{"type":"string","description":"Watch the session. Sent with streamWebView."},"interactiveLiveViewUrl":{"type":"string","description":"Watch and control the session. Sent with streamWebView."},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/browser/{session_id}/uploads":{"post":{"operationId":"browserUpload","summary":"Put a file in an open browser session, for a file field to use.","description":"Free. Send base64 with a name, or a url.","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"base64":{"type":"string","maxLength":27962028,"format":"base64","contentEncoding":"base64","pattern":"^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$"},"url":{"type":"string","maxLength":2000,"format":"uri"}}}}}},"responses":{"200":{"description":"The file in the session.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"name":{"type":"string"},"size":{"type":"integer"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/browser/{session_id}/replay":{"get":{"operationId":"browserReplay","summary":"List the pages a closed session visited and the steps on each.","description":"Free. A session sent with zeroDataRetention has no replay.","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The replay.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"id":{"type":"string"},"pages":{"type":"array","items":{"type":"object","properties":{"pageId":{"type":"string"},"url":{"type":"string"},"title":{"type":"string"},"at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"steps":{"type":"array","items":{"type":"string"}},"screenshot":{"type":"string"}},"required":["pageId","url","title","at","steps"]}},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/browser/{session_id}/replay/{page_id}":{"get":{"operationId":"browserReplayPage","summary":"Read one replay page, with its screenshot.","description":"Free.","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"page_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The page.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"page":{"type":"object","properties":{"pageId":{"type":"string"},"url":{"type":"string"},"title":{"type":"string"},"at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"steps":{"type":"array","items":{"type":"string"}},"screenshot":{"type":"string"}},"required":["pageId","url","title","at","steps"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/browser/profiles":{"post":{"operationId":"browserProfileCreate","summary":"Create an empty browser profile.","description":"Free. A profile is also created by the first session opened with its name. Answers 409 when the name is taken.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"The profile.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"name":{"type":"string"},"cookies":{"type":"integer"},"origins":{"type":"integer"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"browserProfiles","summary":"List your saved browser profiles, most recently used first","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"profiles":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"lastUsedAt":{"type":"string"}},"required":[]}}},"required":["profiles"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/browser/profiles/{name}":{"get":{"operationId":"browserProfileGet","summary":"See a saved browser profile.","description":"Free.","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The profile.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"name":{"type":"string"},"cookies":{"type":"integer"},"origins":{"type":"integer"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"browserProfileUpdate","summary":"Rename a browser profile, with its cookies and logins kept.","description":"Free. Answers 409 when the new name is taken or a session is saving to the profile now. saveChanges is chosen for each session, not stored on the profile.","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"The renamed profile.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"name":{"type":"string"},"cookies":{"type":"integer"},"origins":{"type":"integer"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"browserProfileDelete","summary":"Delete a saved browser profile.","description":"Free.","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The profile is deleted.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/scrape/{id}/interact":{"post":{"operationId":"scrapeInteract","summary":"Keep working on a scraped page in a browser session.","description":"The first call opens a session on the page the scrape read; later calls reuse it. Billed like a browser session.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":200000},"prompt":{"type":"string","minLength":1,"maxLength":10000},"language":{"default":"node","type":"string","enum":["node","python","bash"]},"timeout":{"type":"integer","minimum":1,"maximum":300},"url":{"type":"string"},"zeroDataRetention":{"type":"boolean"}},"additionalProperties":{}}}}},"responses":{"200":{"description":"What the run printed and returned.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"output":{"type":"string","description":"What the code printed."},"stdout":{"type":"string"},"result":{"type":"string","description":"The value the code returned, as text."},"stderr":{"type":"string"},"exitCode":{"type":"integer"},"killed":{"type":"boolean","description":"true when the code ran out of time."},"truncated":{"type":"boolean","description":"True when standard output contains a notice that it was cut. A large returned result can be dropped without setting this flag."},"error":{"type":"string"},"steps":{"type":"array","items":{"type":"string"}},"page":{"type":"object","properties":{"url":{"type":"string"},"title":{"type":"string"}}},"cdpUrl":{"type":"string","description":"Connect a CDP client such as Playwright here."},"liveViewUrl":{"type":"string","description":"Watch the session. Sent with streamWebView."},"interactiveLiveViewUrl":{"type":"string","description":"Watch and control the session. Sent with streamWebView."},"warning":{"type":"string"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"scrapeInteractStop","summary":"Close the session of a scrape and bill the time it was open.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The session is closed.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"recordingStatus":{"type":"string","enum":["none","recording","processing","ready","failed"],"description":"none: the session was not recorded, or its video was deleted. recording: the session is running. processing: the session stopped and the video is being made, usually within a few minutes, or the status could not be read yet, so read it again. ready: recordingUrl works. failed: the video was never made and cannot be any more. A ready video is kept 7 days."},"sessionDurationMs":{"type":"integer"},"proxyBytes":{"type":"integer"},"exitBytes":{"type":"object","description":"Traffic by kind of network. Each kind is billed at its own rate.","properties":{"managed":{"type":"integer"},"direct":{"type":"integer"},"custom":{"type":"integer"}}},"creditsBilled":{"type":"integer"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/search/research/papers":{"get":{"summary":"Search research papers by title and abstract.","description":"Costs $0.001 per block of up to 10 returned results; no results cost nothing.","responses":{"200":{"description":"The results.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"results":{"type":"array","items":{"type":"object","properties":{"paperId":{"type":"string"},"primaryId":{"type":"string"},"ids":{"type":"object"},"title":{"type":"string"},"abstract":{"type":"string"},"authors":{"type":"array","items":{"type":"string"}},"year":{"type":"integer"},"venue":{"type":"string"},"citedByCount":{"type":"integer"},"openAccessUrl":{"type":"string"},"score":{"type":"number"}}}},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}},"operationId":"searchResearchPapersGet","parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"k","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":40,"description":"How many results to return."}},{"name":"authors","in":"query","required":false,"schema":{"type":"string","description":"Only papers with an author whose name has this."}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["relevance","date_desc"],"default":"relevance"}}]},"post":{"summary":"Search research papers by title and abstract.","description":"Costs $0.001 per block of up to 10 returned results; no results cost nothing.","responses":{"200":{"description":"The results.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"results":{"type":"array","items":{"type":"object","properties":{"paperId":{"type":"string"},"primaryId":{"type":"string"},"ids":{"type":"object"},"title":{"type":"string"},"abstract":{"type":"string"},"authors":{"type":"array","items":{"type":"string"}},"year":{"type":"integer"},"venue":{"type":"string"},"citedByCount":{"type":"integer"},"openAccessUrl":{"type":"string"},"score":{"type":"number"}}}},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}},"operationId":"searchResearchPapers","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["query"],"properties":{"query":{"type":"string","minLength":1},"k":{"type":"integer","minimum":1,"maximum":500,"default":40,"description":"How many results to return."},"authors":{"type":"string","description":"Only papers with an author whose name has this."},"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"},"sort":{"type":"string","enum":["relevance","date_desc"],"default":"relevance"}}}}}}}},"/v1/search/research/papers/{id}":{"get":{"operationId":"researchPaper","summary":"Read one paper by its paperId, doi:<DOI> or arxiv:<id>.","description":"Costs $0.001 per paper. With query, also returns the passages that match it.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"query","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"k","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50}}],"responses":{"200":{"description":"The paper.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"paper":{"type":"object"},"paperId":{"type":"string"},"query":{"type":"string"},"passages":{"type":"array","items":{"type":"object"}},"note":{"type":"string"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/search/research/papers/{id}/similar":{"get":{"operationId":"researchPaperSimilar","summary":"Find papers like this one.","description":"Costs $0.001 per block of up to 10 returned results; no results cost nothing.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"intent","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"mode","in":"query","required":false,"schema":{"type":"string","enum":["similar"]}},{"name":"k","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":40,"description":"How many results to return."}},{"name":"anchor","in":"query","required":false,"description":"More paper ids to find papers like. Repeat it for each.","schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Papers like it.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"results":{"type":"array","items":{"type":"object","properties":{"paperId":{"type":"string"},"primaryId":{"type":"string"},"ids":{"type":"object"},"title":{"type":"string"},"abstract":{"type":"string"},"authors":{"type":"array","items":{"type":"string"}},"year":{"type":"integer"},"venue":{"type":"string"},"citedByCount":{"type":"integer"},"openAccessUrl":{"type":"string"},"score":{"type":"number"}}}},"poolSize":{"type":"integer"},"truncated":{"type":"boolean"},"note":{"type":"string"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/search/developer":{"get":{"summary":"Search code docs, READMEs, issues, pull requests and releases.","description":"Costs $0.001 per block of up to 10 returned results; no results cost nothing.","responses":{"200":{"description":"The results.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"partial":{"type":"boolean"},"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"title":{"type":"string"},"passages":{"type":"array","items":{"type":"object"}},"type":{"type":"string"},"repo":{"type":["string","null"]},"stars":{"type":["integer","null"]},"language":{"type":["string","null"]},"date":{"type":["string","null"]},"state":{"type":["string","null"]}}}},"repos":{"type":"array","items":{"type":"object"}},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}},"operationId":"searchDeveloperGet","parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"k","in":"query","required":false,"schema":{"default":10,"type":"integer","minimum":1,"maximum":100}},{"name":"types","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"name":"repos","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"name":"language","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"min_stars","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"max_stars","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"passages","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["true","false"]}]}}]},"post":{"summary":"Search code docs, READMEs, issues, pull requests and releases.","description":"Costs $0.001 per block of up to 10 returned results; no results cost nothing.","responses":{"200":{"description":"The results.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"partial":{"type":"boolean"},"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"title":{"type":"string"},"passages":{"type":"array","items":{"type":"object"}},"type":{"type":"string"},"repo":{"type":["string","null"]},"stars":{"type":["integer","null"]},"language":{"type":["string","null"]},"date":{"type":["string","null"]},"state":{"type":["string","null"]}}}},"repos":{"type":"array","items":{"type":"object"}},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}},"operationId":"searchDeveloper","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","minLength":1},"k":{"default":10,"type":"integer","minimum":1,"maximum":100},"types":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"repos":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"language":{"type":"string","minLength":1},"min_stars":{"type":"integer","minimum":0,"maximum":9007199254740991},"max_stars":{"type":"integer","minimum":0,"maximum":9007199254740991},"passages":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["true","false"]}]}},"required":["query"],"additionalProperties":false}}}}}},"/v1/monitor":{"post":{"operationId":"monitorCreate","summary":"Watch pages and search results on a schedule and record what changed. A check costs $1 per 1,000 pages for page targets. For each search target, the charge is $0.001 per block of up to 10 results after merging and deduplicating results from its queries. Watched JSON adds $3 per 1,000 pages when it comes back. Each judgement adds $0.001.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"origin":{"description":"Set by client libraries. Ignored.","type":"string","maxLength":200},"integration":{"description":"Set by client libraries. Ignored.","type":"string","maxLength":200},"name":{"description":"A name for the monitor.","type":"string","minLength":1,"maxLength":256},"schedule":{"type":"object","properties":{"cron":{"description":"Five-field cron expression. The minimum interval is 5 minutes.","type":"string"},"text":{"description":"Plain-words schedule: every 30 minutes, every 15 minutes starting at :07, hourly, every 2 hours, daily, daily at 9:00, daily at 9am, daily at 5:30 PM, weekly.","type":"string"},"timezone":{"default":"UTC","description":"IANA timezone for the schedule.","type":"string"}}},"targets":{"minItems":1,"maxItems":50,"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"description":"A stable id for this target. Made for you when left out.","type":"string","minLength":1,"maxLength":64},"type":{"type":"string","const":"scrape"},"urls":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string"},"description":"The pages to read on every check."},"scrapeOptions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/monitorCreate.27.schema0"},"description":"The same options as POST /v1/scrape, except url. formats says what to compare: the first of markdown, html, rawHtml or links is compared (markdown by default); add changeTracking with modes git-diff and json, or a json format with a schema or prompt, to compare fields."}},"required":["type","urls"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"type":{"type":"string","const":"crawl"},"url":{"description":"The page to start from. Every check finds the pages under it again and reads each one.","type":"string"},"crawlOptions":{"type":"object","properties":{"limit":{"default":100,"description":"The most pages to read on each check, up to 500. 100 by default.","type":"integer","minimum":1,"maximum":500},"maxDepth":{"description":"How many path levels below the start page to go, up to 10.","type":"integer","minimum":0,"maximum":10},"maxDiscoveryDepth":{"description":"The same as maxDepth.","type":"integer","minimum":0,"maximum":10},"includePaths":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"excludePaths":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"regexOnFullURL":{"default":false,"type":"boolean"},"crawlEntireDomain":{"default":false,"type":"boolean"},"allowSubdomains":{"default":false,"type":"boolean"},"ignoreQueryParameters":{"default":true,"type":"boolean"},"sitemap":{"default":"include","type":"string","enum":["skip","include","only"]}},"additionalProperties":false},"scrapeOptions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/monitorCreate.27.schema0"},"description":"The same options as POST /v1/scrape, except url. formats says what to compare: the first of markdown, html, rawHtml or links is compared (markdown by default); add changeTracking with modes git-diff and json, or a json format with a schema or prompt, to compare fields."}},"required":["type","url"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"type":{"type":"string","const":"search"},"queries":{"minItems":1,"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":256},"description":"Search queries to run on each check, 1 to 12."},"searchWindow":{"default":"24h","description":"Only results published within this window. The search engine's own steps are a day and a week, so the smaller windows use a day.","type":"string","enum":["5m","15m","1h","6h","24h","7d"]},"maxResults":{"default":10,"description":"Results to look at on each check, merged and deduplicated across the queries.","type":"integer","minimum":1,"maximum":50},"includeDomains":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9.-]+\\.[a-z]{2,}$"}},"excludeDomains":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9.-]+\\.[a-z]{2,}$"}}},"required":["type","queries"],"additionalProperties":false}]}},"goal":{"description":"What matters to you, in plain words. With a goal, every changed page is judged against it ($1 per 1,000 pages more for each changed page) and the page says whether the change is meaningful. judgeEnabled false turns the judge off.","anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"judgeEnabled":{"type":"boolean"},"retentionDays":{"type":"integer","minimum":1,"maximum":365,"description":"How many days checks, diffs and snapshots are kept. 30 by default."},"webhook":{"type":"object","properties":{"url":{"type":"string"},"headers":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9-]{1,64}$"},"additionalProperties":{"type":"string","maxLength":1000}},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/monitorCreate.27.schema0"}},"events":{"description":"Which events to send: monitor.page (a page changed, appeared or went away), monitor.check.completed (a check finished), and the older monitor.changed and monitor.failed. A monitor made with url or interval sends the older two by default, any other the first two. Every call has an eventId that stays the same when the call is sent again, so you can skip one you already handled.","minItems":1,"type":"array","items":{"type":"string","enum":["monitor.page","monitor.check.completed","monitor.changed","monitor.failed"]}}},"required":["url"],"additionalProperties":false},"notification":{"type":"object","properties":{"email":{"type":"object","properties":{"enabled":{"default":false,"description":"Send an email when a check finds a change. Off by default.","type":"boolean"},"recipients":{"description":"Who gets the email, up to 25. Your own account address gets mail at once. Any other address is sent a confirmation link first and gets nothing else until it is clicked.","maxItems":25,"type":"array","items":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"includeDiffs":{"default":false,"description":"Put the changed text of each changed page in the email.","type":"boolean"}},"additionalProperties":false}},"additionalProperties":false},"url":{"description":"The page to watch. The older way: use targets.","type":"string"},"urls":{"description":"The pages to watch, up to 100. The older way: use targets.","minItems":1,"maxItems":100,"type":"array","items":{"type":"string"}},"interval":{"description":"How often to check, at least every 5 minutes: seconds, or text such as 30m, 6h, 1d. The older way: use schedule.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"string","pattern":"^\\d+[smhd]$"}]},"formats":{"description":"What to compare. The older way: use targets.","minItems":1,"type":"array","items":{"type":"string","enum":["markdown","html","rawHtml","links"]}},"changeTracking":{"type":"object","properties":{"modes":{"description":"diff (or git-diff) returns the text change. json returns the fields you ask for, before and after.","minItems":1,"type":"array","items":{"type":"string","enum":["diff","git-diff","json"]}},"schema":{"description":"The JSON Schema of the fields to compare.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/monitorCreate.27.schema0"}},"prompt":{"description":"What to compare, in words.","type":"string","minLength":1,"maxLength":1000}}}},"additionalProperties":false}}}},"responses":{"200":{"description":"The monitor, with its next run.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"id":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused"]},"pausedReason":{"type":"string"},"schedule":{"type":"object","properties":{"cron":{"type":["string","null"]},"timezone":{"type":"string"},"everySeconds":{"type":["integer","null"]}}},"nextRunAt":{"type":["string","null"],"format":"date-time"},"lastRunAt":{"type":["string","null"],"format":"date-time"},"currentCheckId":{"type":["string","null"]},"targets":{"type":"array","items":{"type":"object"}},"retentionDays":{"type":"integer"},"estimatedCreditsPerMonth":{"type":"integer","description":"Older field: the estimated cost over 30 days, in $0.002 steps."},"estimatedCostUsdPerMonth":{"type":"number","description":"Estimated cost of scheduled checks over 30 days, including search, watched JSON and judging, in dollars."},"webhook":{"type":["object","null"]},"createdAt":{"type":"string","format":"date-time"},"urls":{"type":"array","items":{"type":"string"},"description":"Older field: every page watched."},"interval":{"type":["integer","null"],"description":"Older field: seconds between checks."},"checks":{"type":"integer"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"Cost recorded in this monitor's page history, in dollars. It excludes search targets. For each check's charge, see actualCostUsd on the check."}}},"next":{"type":["string","null"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"monitorList","summary":"List your monitors, newest first.","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Your monitors.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"id":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused"]},"pausedReason":{"type":"string"},"schedule":{"type":"object","properties":{"cron":{"type":["string","null"]},"timezone":{"type":"string"},"everySeconds":{"type":["integer","null"]}}},"nextRunAt":{"type":["string","null"],"format":"date-time"},"lastRunAt":{"type":["string","null"],"format":"date-time"},"currentCheckId":{"type":["string","null"]},"targets":{"type":"array","items":{"type":"object"}},"retentionDays":{"type":"integer"},"estimatedCreditsPerMonth":{"type":"integer","description":"Older field: the estimated cost over 30 days, in $0.002 steps."},"estimatedCostUsdPerMonth":{"type":"number","description":"Estimated cost of scheduled checks over 30 days, including search, watched JSON and judging, in dollars."},"webhook":{"type":["object","null"]},"createdAt":{"type":"string","format":"date-time"},"urls":{"type":"array","items":{"type":"string"},"description":"Older field: every page watched."},"interval":{"type":["integer","null"],"description":"Older field: seconds between checks."},"checks":{"type":"integer"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"Cost recorded in this monitor's page history, in dollars. It excludes search targets. For each check's charge, see actualCostUsd on the check."}}}},"next":{"type":["string","null"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/monitor/{id}":{"get":{"operationId":"monitorGet","summary":"Read one monitor.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The monitor id."}],"responses":{"200":{"description":"The monitor.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"id":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused"]},"pausedReason":{"type":"string"},"schedule":{"type":"object","properties":{"cron":{"type":["string","null"]},"timezone":{"type":"string"},"everySeconds":{"type":["integer","null"]}}},"nextRunAt":{"type":["string","null"],"format":"date-time"},"lastRunAt":{"type":["string","null"],"format":"date-time"},"currentCheckId":{"type":["string","null"]},"targets":{"type":"array","items":{"type":"object"}},"retentionDays":{"type":"integer"},"estimatedCreditsPerMonth":{"type":"integer","description":"Older field: the estimated cost over 30 days, in $0.002 steps."},"estimatedCostUsdPerMonth":{"type":"number","description":"Estimated cost of scheduled checks over 30 days, including search, watched JSON and judging, in dollars."},"webhook":{"type":["object","null"]},"createdAt":{"type":"string","format":"date-time"},"urls":{"type":"array","items":{"type":"string"},"description":"Older field: every page watched."},"interval":{"type":["integer","null"],"description":"Older field: seconds between checks."},"checks":{"type":"integer"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"Cost recorded in this monitor's page history, in dollars. It excludes search targets. For each check's charge, see actualCostUsd on the check."}}},"next":{"type":["string","null"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"monitorUpdate","summary":"Change a monitor: its name, schedule, targets, webhook, retention, or pause and resume it.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The monitor id."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"origin":{"description":"Set by client libraries. Ignored.","type":"string","maxLength":200},"integration":{"description":"Set by client libraries. Ignored.","type":"string","maxLength":200},"name":{"description":"A name for the monitor.","type":"string","minLength":1,"maxLength":256},"schedule":{"type":"object","properties":{"cron":{"description":"Five-field cron expression. The minimum interval is 5 minutes.","type":"string"},"text":{"description":"Plain-words schedule: every 30 minutes, every 15 minutes starting at :07, hourly, every 2 hours, daily, daily at 9:00, daily at 9am, daily at 5:30 PM, weekly.","type":"string"},"timezone":{"default":"UTC","description":"IANA timezone for the schedule.","type":"string"}}},"targets":{"minItems":1,"maxItems":50,"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"description":"A stable id for this target. Made for you when left out.","type":"string","minLength":1,"maxLength":64},"type":{"type":"string","const":"scrape"},"urls":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string"},"description":"The pages to read on every check."},"scrapeOptions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/monitorUpdate.28.schema0"},"description":"The same options as POST /v1/scrape, except url. formats says what to compare: the first of markdown, html, rawHtml or links is compared (markdown by default); add changeTracking with modes git-diff and json, or a json format with a schema or prompt, to compare fields."}},"required":["type","urls"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"type":{"type":"string","const":"crawl"},"url":{"description":"The page to start from. Every check finds the pages under it again and reads each one.","type":"string"},"crawlOptions":{"type":"object","properties":{"limit":{"default":100,"description":"The most pages to read on each check, up to 500. 100 by default.","type":"integer","minimum":1,"maximum":500},"maxDepth":{"description":"How many path levels below the start page to go, up to 10.","type":"integer","minimum":0,"maximum":10},"maxDiscoveryDepth":{"description":"The same as maxDepth.","type":"integer","minimum":0,"maximum":10},"includePaths":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"excludePaths":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"regexOnFullURL":{"default":false,"type":"boolean"},"crawlEntireDomain":{"default":false,"type":"boolean"},"allowSubdomains":{"default":false,"type":"boolean"},"ignoreQueryParameters":{"default":true,"type":"boolean"},"sitemap":{"default":"include","type":"string","enum":["skip","include","only"]}},"additionalProperties":false},"scrapeOptions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/monitorUpdate.28.schema0"},"description":"The same options as POST /v1/scrape, except url. formats says what to compare: the first of markdown, html, rawHtml or links is compared (markdown by default); add changeTracking with modes git-diff and json, or a json format with a schema or prompt, to compare fields."}},"required":["type","url"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"type":{"type":"string","const":"search"},"queries":{"minItems":1,"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":256},"description":"Search queries to run on each check, 1 to 12."},"searchWindow":{"default":"24h","description":"Only results published within this window. The search engine's own steps are a day and a week, so the smaller windows use a day.","type":"string","enum":["5m","15m","1h","6h","24h","7d"]},"maxResults":{"default":10,"description":"Results to look at on each check, merged and deduplicated across the queries.","type":"integer","minimum":1,"maximum":50},"includeDomains":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9.-]+\\.[a-z]{2,}$"}},"excludeDomains":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9.-]+\\.[a-z]{2,}$"}}},"required":["type","queries"],"additionalProperties":false}]}},"retentionDays":{"type":"integer","minimum":1,"maximum":365,"description":"How many days checks, diffs and snapshots are kept. 30 by default."},"webhook":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"},"headers":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9-]{1,64}$"},"additionalProperties":{"type":"string","maxLength":1000}},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/monitorUpdate.28.schema0"}},"events":{"description":"Which events to send: monitor.page (a page changed, appeared or went away), monitor.check.completed (a check finished), and the older monitor.changed and monitor.failed. A monitor made with url or interval sends the older two by default, any other the first two. Every call has an eventId that stays the same when the call is sent again, so you can skip one you already handled.","minItems":1,"type":"array","items":{"type":"string","enum":["monitor.page","monitor.check.completed","monitor.changed","monitor.failed"]}}},"required":["url"],"additionalProperties":false},{"type":"null"}]},"notification":{"anyOf":[{"type":"object","properties":{"email":{"type":"object","properties":{"enabled":{"default":false,"description":"Send an email when a check finds a change. Off by default.","type":"boolean"},"recipients":{"description":"Who gets the email, up to 25. Your own account address gets mail at once. Any other address is sent a confirmation link first and gets nothing else until it is clicked.","maxItems":25,"type":"array","items":{"type":"string","maxLength":254,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"includeDiffs":{"default":false,"description":"Put the changed text of each changed page in the email.","type":"boolean"}},"additionalProperties":false}},"additionalProperties":false},{"type":"null"}]},"goal":{"description":"What matters to you, in plain words. With a goal, every changed page is judged against it ($1 per 1,000 pages more for each changed page) and the page says whether the change is meaningful. judgeEnabled false turns the judge off.","anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"judgeEnabled":{"type":"boolean"},"status":{"description":"paused stops the checks; active starts them again.","type":"string","enum":["active","paused"]}},"additionalProperties":false}}}},"responses":{"200":{"description":"The monitor as it is now.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"id":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused"]},"pausedReason":{"type":"string"},"schedule":{"type":"object","properties":{"cron":{"type":["string","null"]},"timezone":{"type":"string"},"everySeconds":{"type":["integer","null"]}}},"nextRunAt":{"type":["string","null"],"format":"date-time"},"lastRunAt":{"type":["string","null"],"format":"date-time"},"currentCheckId":{"type":["string","null"]},"targets":{"type":"array","items":{"type":"object"}},"retentionDays":{"type":"integer"},"estimatedCreditsPerMonth":{"type":"integer","description":"Older field: the estimated cost over 30 days, in $0.002 steps."},"estimatedCostUsdPerMonth":{"type":"number","description":"Estimated cost of scheduled checks over 30 days, including search, watched JSON and judging, in dollars."},"webhook":{"type":["object","null"]},"createdAt":{"type":"string","format":"date-time"},"urls":{"type":"array","items":{"type":"string"},"description":"Older field: every page watched."},"interval":{"type":["integer","null"],"description":"Older field: seconds between checks."},"checks":{"type":"integer"},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"Cost recorded in this monitor's page history, in dollars. It excludes search targets. For each check's charge, see actualCostUsd on the check."}}},"next":{"type":["string","null"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"monitorDelete","summary":"Delete a monitor and stop its checks.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The monitor id."}],"responses":{"200":{"description":"Deleted.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"id":{"type":"string"},"data":{"type":"object"},"next":{"type":["string","null"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/monitor/{id}/run":{"post":{"operationId":"monitorRun","summary":"Check the monitor now, outside its schedule. Answers 409 while a check is running or the monitor is paused. A check costs $1 per 1,000 pages for page targets. For each search target, the charge is $0.001 per block of up to 10 results after merging and deduplicating results from its queries. Watched JSON adds $3 per 1,000 pages when it comes back. Each judgement adds $0.001.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The monitor id."}],"responses":{"200":{"description":"The queued check. Its id is also in id.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"id":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string"},"monitorId":{"type":"string"},"status":{"type":"string","enum":["queued","running","completed","failed","partial","skipped_overlap","skipped_no_credits"]},"trigger":{"type":"string","enum":["scheduled","manual"]},"scheduledFor":{"type":["string","null"],"format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"finishedAt":{"type":["string","null"],"format":"date-time"},"estimatedCredits":{"type":"integer","description":"Older field: the estimated cost of this check, in $0.002 steps."},"estimatedCostUsd":{"type":"number","description":"Estimated cost of this check, including search, watched JSON and judging, in dollars."},"reservedCredits":{"type":["integer","null"]},"actualCredits":{"type":["integer","null"],"description":"Older field: what was charged once the check is done, in $0.002 steps."},"actualCostUsd":{"type":["number","null"],"description":"What was charged once the check is done, in dollars."},"billingStatus":{"type":"string","enum":["not_applicable","reserved","confirmed","released","failed"]},"summary":{"type":"object","properties":{"totalPages":{"type":"integer"},"same":{"type":"integer"},"changed":{"type":"integer"},"new":{"type":"integer"},"removed":{"type":"integer"},"error":{"type":"integer"}}},"error":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"next":{"type":["string","null"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/monitor/{id}/checks":{"get":{"operationId":"monitorChecks","summary":"List the checks of a monitor, newest first.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The monitor id."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}},{"name":"status","in":"query","schema":{"type":"string","enum":["queued","running","completed","failed","partial","skipped_overlap","skipped_no_credits"]}}],"responses":{"200":{"description":"The checks.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"id":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"monitorId":{"type":"string"},"status":{"type":"string","enum":["queued","running","completed","failed","partial","skipped_overlap","skipped_no_credits"]},"trigger":{"type":"string","enum":["scheduled","manual"]},"scheduledFor":{"type":["string","null"],"format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"finishedAt":{"type":["string","null"],"format":"date-time"},"estimatedCredits":{"type":"integer","description":"Older field: the estimated cost of this check, in $0.002 steps."},"estimatedCostUsd":{"type":"number","description":"Estimated cost of this check, including search, watched JSON and judging, in dollars."},"reservedCredits":{"type":["integer","null"]},"actualCredits":{"type":["integer","null"],"description":"Older field: what was charged once the check is done, in $0.002 steps."},"actualCostUsd":{"type":["number","null"],"description":"What was charged once the check is done, in dollars."},"billingStatus":{"type":"string","enum":["not_applicable","reserved","confirmed","released","failed"]},"summary":{"type":"object","properties":{"totalPages":{"type":"integer"},"same":{"type":"integer"},"changed":{"type":"integer"},"new":{"type":"integer"},"removed":{"type":"integer"},"error":{"type":"integer"}}},"error":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"next":{"type":["string","null"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/monitor/{id}/checks/{checkId}":{"get":{"operationId":"monitorCheck","summary":"One check with the result for each page: same, new, changed, removed or error, with the diff. next is the address of the next page of results.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The monitor id."},{"name":"checkId","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"skip","in":"query","schema":{"type":"integer","minimum":0,"default":0}},{"name":"status","in":"query","schema":{"type":"string","enum":["same","new","changed","removed","error"]}}],"responses":{"200":{"description":"The check and its pages.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"id":{"type":"string"},"data":{"allOf":[{"type":"object","properties":{"id":{"type":"string"},"monitorId":{"type":"string"},"status":{"type":"string","enum":["queued","running","completed","failed","partial","skipped_overlap","skipped_no_credits"]},"trigger":{"type":"string","enum":["scheduled","manual"]},"scheduledFor":{"type":["string","null"],"format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"finishedAt":{"type":["string","null"],"format":"date-time"},"estimatedCredits":{"type":"integer","description":"Older field: the estimated cost of this check, in $0.002 steps."},"estimatedCostUsd":{"type":"number","description":"Estimated cost of this check, including search, watched JSON and judging, in dollars."},"reservedCredits":{"type":["integer","null"]},"actualCredits":{"type":["integer","null"],"description":"Older field: what was charged once the check is done, in $0.002 steps."},"actualCostUsd":{"type":["number","null"],"description":"What was charged once the check is done, in dollars."},"billingStatus":{"type":"string","enum":["not_applicable","reserved","confirmed","released","failed"]},"summary":{"type":"object","properties":{"totalPages":{"type":"integer"},"same":{"type":"integer"},"changed":{"type":"integer"},"new":{"type":"integer"},"removed":{"type":"integer"},"error":{"type":"integer"}}},"error":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},{"type":"object","properties":{"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"targetId":{"type":"string"},"url":{"type":"string"},"status":{"type":"string","enum":["same","new","changed","removed","error"]},"statusCode":{"type":["integer","null"]},"error":{"type":["string","null"]},"diff":{"type":["object","null"],"description":"text is the unified diff of the compared text. json maps each changed field path to { previous, current }."},"snapshot":{"type":["object","null"],"description":"json is the fields read on this check."},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"createdAt":{"type":"string","format":"date-time"}}}}}}]},"next":{"type":["string","null"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/monitor/{id}/changes":{"get":{"operationId":"monitorChanges","summary":"The change history of a monitor, newest first: one row per page per check.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The monitor id."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"url","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string","enum":["new","same","changed","removed"]}}],"responses":{"200":{"description":"The history.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"object","required":["success","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"id":{"type":"string"},"data":{"type":"array","items":{"type":"object"}},"next":{"type":["string","null"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/search":{"post":{"operationId":"search","summary":"Search the web, news, images, scholarly papers and YouTube videos in one call","description":"Costs $0.001 per block of up to 10 returned results, counted separately for each source and each research or videos list ($1 per 1,000 single-source searches returning 1 to 10 results). With scrapeOptions.formats, page reads and their add-ons use scrape pricing, starting at $1 per 1,000 pages for a standard read. Works without an API key, within free limits.","security":[{},{"apiKey":[]}],"x-credits":1,"x-credits-max":8760,"x-cost-usd":0.001,"x-cost-usd-max":17.52,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"description":"What to search for, up to 500 characters. Search operators work in web results: quotes for an exact phrase, -word, site:, -site:, filetype:, inurl:, allinurl:, intitle: and allintitle:. In image results, imagesize:WIDTHxHEIGHT keeps images of exactly that size and larger:WIDTHxHEIGHT keeps images at least that large.","type":"string","minLength":1,"maxLength":500},"sources":{"description":"What to search: web, news, images. Each is a string or {type}. Default web, or none when categories asks for research or videos.","minItems":1,"maxItems":5,"type":"array","items":{"anyOf":[{"type":"string","enum":["web","news","images"]},{"type":"object","properties":{"type":{"type":"string","const":"web"},"tbs":{"type":"string"},"location":{"type":"string"},"country":{"type":"string","pattern":"^[A-Za-z]{2}$","description":"ISO 3166-1 alpha-2 country code, e.g. us. Any case is accepted."},"lang":{"description":"Two-letter language for web results, like de. A web source that does not support this language for the selected country can return results in another language with a warning.","type":"string","pattern":"^[A-Za-z]{2}$"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["news","images"]}},"required":["type"],"additionalProperties":false}]}},"categories":{"description":"pdf: web results that are PDF files. research: scholarly papers, in a research list, ranked by relevance then citations. videos: YouTube videos for the query, in YouTube's order, in a videos list, with the channel, length, views and watch link; a video whose captions we hold also gets the passage that matches the query and where it starts.","type":"array","items":{"anyOf":[{"type":"string","enum":["research","pdf","videos"]},{"type":"object","properties":{"type":{"type":"string","enum":["research","pdf","videos"]}},"required":["type"],"additionalProperties":false}]}},"maxAge":{"description":"Accept a stored answer up to this many milliseconds old, at most 30 days. Without it, 15 minutes for news and 1 hour for web and images. 0 always searches live.","type":"integer","minimum":0,"maximum":9007199254740991},"limit":{"description":"Most results to return for each source. Default 10, or 5 when scrapeOptions has formats, which reads every web and news result returned unless scrapeLimit sets fewer. News returns at most 50.","type":"integer","minimum":1,"maximum":100},"scrapeLimit":{"description":"With scrapeOptions formats: read only the top this many web results and the top this many news results, and return the other results without page text. Cannot be more than limit. Without it every result returned is read. Only pages that are read are charged for.","type":"integer","minimum":1,"maximum":100},"tbs":{"description":"Time filter: qdr:d, qdr:w, qdr:m or qdr:y, or cdr:1,cd_min:MM/DD/YYYY,cd_max:MM/DD/YYYY, plus sbd:1, like sbd:1,qdr:w. sbd:1 sorts newest first; results without a date come last. Web takes all of them; news takes qdr and sbd; images take none.","type":"string","minLength":1},"location":{"description":"Where to search from, like Germany or San Francisco,California,United States. The last part is the country and replaces country. A city before it narrows web results to that place.","type":"string","minLength":1},"country":{"description":"Two-letter country to search from, like us. uk is read as gb. Image results are always US.","type":"string","pattern":"^[A-Za-z]{2}$"},"lang":{"description":"Two-letter language preference, like de. Applies to web results when web is selected, otherwise to news where supported. Results from a source that cannot honor it may be in another language and come with a warning.","type":"string","pattern":"^[A-Za-z]{2}$"},"includeDomains":{"maxItems":10,"type":"array","items":{"type":"string"}},"excludeDomains":{"maxItems":10,"type":"array","items":{"type":"string"}},"safe":{"description":"Hide explicit web, news and image results when true.","type":"boolean"},"timeout":{"description":"Milliseconds to wait for the sources, from 1,000 to 120,000; more is read as 120,000. Default 3,000, or 60,000 when scrapeOptions has formats and the search reads pages. A source that has not answered by then is left out with a warning. When none has, the call fails and costs nothing.","type":"integer","minimum":1000,"maximum":9007199254740991},"ignoreInvalidURLs":{"default":false,"description":"Leave out results whose address cannot be read as a page.","type":"boolean"},"highlights":{"default":false,"description":"Off by default. With true, a web result whose page we already hold gets the passages that best match the query as its description, in markdown, up to about 2,000 characters; others keep the engine's snippet.","type":"boolean"},"scrapeOptions":{"description":"With formats, reads each web and news result, as many as scrapeLimit or limit asks for, within timeout, and fills each web result's description from it. Without formats no page is read and nothing more is charged. Takes the options of scrape: formats (markdown, html, rawHtml, links, images, summary, screenshot, json and the rest), onlyMainContent, includeTags, excludeTags, maxAge, minAge, waitFor, mobile, timeout (per page), headers, actions, location, parsers, profile and zeroDataRetention. redactPII uses patterns on web descriptions, news snippets, research snippets and video snippets, even without formats, when sources has web or news. Titles and URLs are unchanged. Snippets can still contain names and places that patterns miss. With formats, page reads and their add-ons use scrape pricing, starting at $1 per 1,000 pages for a standard read.","type":"object","properties":{"formats":{"description":"What to return: markdown (clean page text), summary (a short summary of the page), html (the cleaned page), rawHtml (the page as sent), audio and video (for a YouTube link: the audio track as an M4A file, or the video as an MP4 file, as a link that works for 1 hour), rawBase64 (the bytes the site sent, Base64 encoded, from a live read; metadata.contentType says what they are; the address of a picture such as a PNG or JPEG is read only with rawBase64 as the only format), links (every link on the page), images (every image address), screenshot (a link to a JPEG of the visible page, kept for 7 days), changeTracking (what changed in the markdown since your key last read this page with the same options, kept 30 days; add modes [\"git-diff\",\"json\"] with a schema or prompt to compare fields too), question (send { \"type\": \"question\", \"question\": \"...\" } to get answer, left out with a warning when the page does not state one), product (title, brand, category, url, description and variants with price, sale, availability and images, left out with a warning when there is none) and menu (merchant, currency and sections of items with prices, left out with a warning when there is none) network (the JSON the page loaded while it rendered, up to 30 responses) and branding (the page's colors, fonts, typography, spacing, button and input styles, logo and brand images, read from how the page looks, with a field left out when the page does not show it). Send { \"type\": \"screenshot\", \"fullPage\": true } for the whole page. Send { \"type\": \"highlights\", \"query\": \"refund policy\" } for the passages that best match a query. Send { \"type\": \"json\", \"schema\": { \"type\": \"object\", \"properties\": { \"price\": { \"type\": \"number\" } } } } or { \"type\": \"json\", \"prompt\": \"the price and the stock\" } for fields filled from the page, each checked against it. Send { \"type\": \"json\", \"parser\": \"amazon-product\" } to get a site's own data as json instead of reading the page; GET /v1/parsers lists the parsers. Send { \"type\": \"json\", \"rules\": { \"title\": \"h1\", \"links\": { \"selector\": \"a\", \"type\": \"list\", \"output\": \"@href\" } } } to read the page with CSS rules and no model, at the page's own price. Send { \"type\": \"attributes\", \"selectors\": [{ \"selector\": \"a\", \"attribute\": \"href\" }] } for attribute values, returned in attributes. Without a parser or rules, json needs a schema or a prompt and is filled from the page. json with a schema or a prompt, summary, highlights, question, product, menu and changeTracking in json mode add $3 per 1,000 pages each when they return something. JSON with CSS rules and attributes add nothing. A named parser uses its own price. Any page read or other paid format you ask for is charged separately. A screenshot, network or branding read costs $1 per 1,000 pages, the same as any page. A PDF comes back as markdown only, and adds $0.50 per 1,000 pages of text from its text layer and $2.50 per 1,000 pages of text read from its picture that comes back. A CSV or an Excel .xlsx file comes back as markdown tables.","default":["markdown"],"minItems":1,"maxItems":20,"type":"array","items":{"anyOf":[{"type":"string","enum":["markdown","summary","html","rawHtml","rawBase64","links","images","network","branding","audio","video","screenshot","changeTracking","product","menu"]},{"type":"object","properties":{"type":{"type":"string","enum":["markdown","summary","html","rawHtml","rawBase64","links","images","network","branding","audio","video"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"changeTracking"},"modes":{"description":"git-diff returns a unified diff of the markdown. json compares the fields in schema or prompt between this read and the last one. Without modes you get git-diff.","maxItems":2,"type":"array","items":{"type":"string","enum":["git-diff","json"]}},"schema":{"description":"The fields to fill, as a JSON Schema (draft-07 or 2020-12) object with properties. Pydantic's model_json_schema() and zod's toJSONSchema() output work as they are. enum, const, anyOf, oneOf, nullable types, $ref with $defs, required, descriptions and any key names are read. Up to 100 top-level fields and 32 KB. A field the page does not state comes back null.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/search.input.schema0"}},"prompt":{"description":"With json mode: what to compare, in plain words, such as the price and stock.","type":"string","minLength":1,"maxLength":10000},"tag":{"type":"null"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"question"},"question":{"type":"string","minLength":1,"maxLength":10000,"description":"A question to answer from the page, such as what the refund window is."}},"required":["type","question"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"product"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"menu"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"screenshot"},"fullPage":{"default":false,"description":"Capture the whole page from top to bottom instead of the visible part.","type":"boolean"},"quality":{"description":"JPEG quality from 1 to 100. The default is 70.","type":"integer","minimum":1,"maximum":100},"viewport":{"description":"The window size in pixels, such as { width: 390, height: 844 }.","type":"object","properties":{"width":{"type":"integer","minimum":200,"maximum":3840},"height":{"type":"integer","minimum":200,"maximum":2160}},"required":["width","height"],"additionalProperties":false}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"highlights"},"query":{"type":"string","minLength":1,"maxLength":10000,"description":"What you are looking for on the page, such as refund policy."},"count":{"default":5,"description":"How many passages to return, best match first.","type":"integer","minimum":1,"maximum":20}},"required":["type","query"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"json"},"parser":{"description":"Read the page with a named parser, which gives the site's own data as json. The url must be the kind of page the parser reads. Parsers are the only way to read some sites. GET /v1/parsers lists them.","type":"string"},"options":{"description":"Only with parser: extra inputs for it, such as { \"page\": 2 } for the next page of results or { \"minRating\": 4.5 } for a filter. GET /v1/parsers lists what each parser accepts.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/search.input.schema1"}},"schema":{"description":"The fields to fill, as a JSON Schema (draft-07 or 2020-12) object with properties. Pydantic's model_json_schema() and zod's toJSONSchema() output work as they are. enum, const, anyOf, oneOf, nullable types, $ref with $defs, required, descriptions and any key names are read. Up to 100 top-level fields and 32 KB. A field the page does not state comes back null.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/search.input.schema0"}},"prompt":{"description":"What to pull from the page in plain words, such as the version and the release date.","type":"string","minLength":1,"maxLength":10000},"rules":{"description":"Read the page with CSS rules instead of a model, no extra fee. Each field is a selector such as \"h1\" (the first match's text), \"a@href\" (an attribute) or { \"selector\": \"li\", \"type\": \"list\", \"output\": \"text\" | \"html\" | \"@attribute\" | { nested fields } }. A missing item is null and an unmatched list is []. Relative links become absolute. Up to 100 fields, 5 levels deep. Not with schema, prompt or parser.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/search.input.schema2"}},"checkPromptInjection":{"description":"Deprecated: send checkPromptInjection at the top level of the call.","type":"boolean"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"attributes"},"selectors":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"selector":{"type":"string","minLength":1},"attribute":{"type":"string","minLength":1,"maxLength":100}},"required":["selector","attribute"],"additionalProperties":false},"description":"The elements and attributes to read, such as { selector: 'a.buy', attribute: 'href' }."}},"required":["type","selectors"],"additionalProperties":false}]}},"onlyMainContent":{"default":true,"description":"Keep only the page's main content, without menus, headers, footers and ads.","type":"boolean"},"onlyCleanContent":{"description":"Send true to have a model remove what onlyMainContent leaves behind in the markdown: cookie banners, ads, share widgets, breadcrumbs, sign-up prompts, comment prompts and related-article lists. It only removes whole paragraphs and lists; it never rewrites or adds text, and code blocks are always kept. Skipped with a warning when the page is too long to clean or the model does not answer. Not with zeroDataRetention. Summary, answers and highlights are made from the cleaned markdown.","type":"boolean"},"includeTags":{"description":"Keep only the parts of the page that match these CSS selectors, such as article or .price. When set, onlyMainContent is not applied.","minItems":1,"type":"array","items":{"type":"string","minLength":1}},"excludeTags":{"description":"Remove the parts of the page that match these CSS selectors, such as .comments.","minItems":1,"type":"array","items":{"type":"string","minLength":1}},"maxAge":{"description":"Accept a stored answer up to this many milliseconds old, at most 30 days. Without it, 2 days, or less for a site whose pages change often, and a copy up to twice that age (at most 7 days) comes back at once as stale while a fresh read runs. 0 always reads the page live. metadata.cacheState says which one you got.","type":"integer","minimum":0,"maximum":9007199254740991},"minAge":{"description":"Answer only from a stored copy that is at least this many milliseconds old, and never read the page live. 0 accepts any stored copy. A page with no such copy is notFound.","type":"integer","minimum":0,"maximum":9007199254740991},"headers":{"description":"Extra request headers to send to the site, such as { \"x-plan\": \"pro\" }. A read with headers is never answered from or saved to a stored copy.","type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9-]{1,64}$"},"additionalProperties":{"type":"string","maxLength":2000,"pattern":"^[\\t\\x20-\\x7e]*$"}},"waitFor":{"description":"Extra milliseconds to wait before reading, up to 60000, for pages that load their content late. To wait for an element, add a wait action with a selector. A read that waits costs $1 per 1,000 pages, the same as any page.","type":"integer","minimum":0,"maximum":60000},"mobile":{"description":"Read the page as a phone would: a phone-sized screen and the mobile version of the site. The page loads in a browser.","type":"boolean"},"skipTlsVerification":{"description":"Send true to read a page whose certificate is expired, self-signed or for another name. The read is not private against someone between us and the site.","type":"boolean"},"timeout":{"default":30000,"description":"How long to keep trying, in milliseconds, from 1 second to 5 minutes; 30 seconds by default. A page that needs a browser needs at least 5 seconds, and pages behind a bot check can need 10 to 30 seconds the first time. A read that runs out of time is an error and costs nothing.","type":"integer","minimum":1000,"maximum":300000},"parsers":{"description":"Only the pdf parser exists. Send \"pdf\" or { \"type\": \"pdf\", mode, maxPages, pages, blocks, pageMarkers } with the same meaning as in parse. Without mode a PDF is read as auto: from its text layer, and from the picture of any page that has no text. fast reads the text layer only, and ocr reads the picture of every page, up to 20 pages. Each page of text that comes back costs $0.50 per 1,000 pages from its text layer and $2.50 per 1,000 pages from its picture. Pictures are read only with an API key.","minItems":1,"type":"array","items":{"anyOf":[{"type":"string","const":"pdf"},{"type":"object","properties":{"type":{"type":"string","const":"pdf"},"mode":{"description":"fast reads the text layer only. auto (the default) reads the text layer and reads the picture of any page that has none. ocr reads the picture of every page.","type":"string","enum":["fast","auto","ocr"]},"maxPages":{"description":"Read at most this many pages, up to 500, which is also the default.","type":"integer","minimum":1,"maximum":500},"pages":{"description":"Send true to also get each page's markdown in pages, as { pageNumber, markdown }. No extra charge.","type":"boolean"},"blocks":{"description":"Send true to also get the page's layout in blocks: each title, section header or run of text, with its page, reading order, position on the page (bbox as left, top, right, bottom from 0 to 1) and where its text sits in that page's markdown (span, as in pages). Tables, figures and formulas are not told apart. A page read from its picture is one block. No extra charge.","type":"boolean"},"pageMarkers":{"description":"Send true to mark page breaks in the markdown: pages are joined with \"---\" and a <!-- page N --> line, where N is the page that follows. No extra charge.","type":"boolean"}},"required":["type"],"additionalProperties":false}]}},"actions":{"description":"Up to 50 steps to run on the page, in order, before reading it: { \"type\": \"wait\", \"milliseconds\": 500 } (up to 60 seconds), { \"type\": \"wait\", \"selector\": \".results\" }, { \"type\": \"click\", \"selector\": \"button.more\" }, { \"type\": \"write\", \"text\": \"tides\" }, { \"type\": \"press\", \"key\": \"Enter\" }, { \"type\": \"scroll\", \"direction\": \"down\" } (also up, left or right; amount is pixels, \"viewport\" or \"max\"; maxScrolls 1 to 50; selector scrolls an inner container; \"max\" keeps scrolling until the page stops growing, for feeds that load as you go), { \"type\": \"screenshot\", \"fullPage\": true } (links come back in actions.screenshots), { \"type\": \"scrape\" } (the page at that point, in actions.scrapes), { \"type\": \"executeJavascript\", \"script\": \"document.title\" } (results in actions.javascriptReturns), { \"type\": \"pdf\", \"format\": \"A4\" } (links in actions.pdfs) or { \"type\": \"perform\", \"action\": \"Click the Load more button\" } (a step in plain words, up to 5 browser steps on this page, never leaving the site; at most 5 per call). A read with actions costs $1 per 1,000 pages, the same as any page; the actions themselves add nothing. If an action fails, you still get the page as it stood, with a warning that names the action and says why.","minItems":1,"maxItems":50,"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"wait"},"milliseconds":{"type":"integer","minimum":1,"maximum":60000}},"required":["type","milliseconds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"wait"},"selector":{"type":"string","minLength":1}},"required":["type","selector"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"click"},"selector":{"type":"string","minLength":1},"all":{"type":"boolean","const":false}},"required":["type","selector"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"write"},"text":{"type":"string","minLength":1}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"press"},"key":{"type":"string","minLength":1,"maxLength":40}},"required":["type","key"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"scroll"},"direction":{"default":"down","type":"string","enum":["up","down","left","right"]},"amount":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"string","enum":["viewport","max"]}]},"maxScrolls":{"type":"integer","minimum":1,"maximum":50},"selector":{"type":"string","minLength":1}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"screenshot"},"fullPage":{"type":"boolean"},"quality":{"type":"integer","minimum":1,"maximum":100},"viewport":{"type":"object","properties":{"width":{"type":"integer","minimum":200,"maximum":3840},"height":{"type":"integer","minimum":200,"maximum":2160}},"required":["width","height"],"additionalProperties":false}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"scrape"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"executeJavascript"},"script":{"type":"string","minLength":1,"maxLength":20000}},"required":["type","script"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"pdf"},"format":{"type":"string","enum":["Letter","Legal","Tabloid","Ledger","A0","A1","A2","A3","A4","A5","A6"]},"landscape":{"type":"boolean"},"scale":{"type":"number","minimum":0.1,"maximum":2}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"perform"},"action":{"type":"string","minLength":1,"maxLength":500}},"required":["type","action"],"additionalProperties":false}]}},"location":{"description":"Where to read the page from. The default is the United States.","type":"object","properties":{"country":{"description":"Two-letter country code to read the page from, such as DE or JP.","type":"string"},"languages":{"description":"Languages to ask the site for, best first, such as [\"de\", \"en\"]. Sent as Accept-Language. A read with languages is never answered from or saved to a stored copy.","minItems":1,"maxItems":5,"type":"array","items":{"type":"string","pattern":"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$"}}},"additionalProperties":false},"removeBase64Images":{"description":"Images inside the page that carry their data in the address (data:image) are dropped by default. Send false to keep them in markdown and html.","type":"boolean"},"blockAds":{"description":"Ads and trackers are not loaded when a page runs in a browser. Send false to load them.","type":"boolean"},"fastMode":{"description":"Send true to read the page without opening a browser: the answer comes sooner, but a page that needs a browser, or that refuses a plain request, comes back as an error instead of being retried. Ignored when the call needs a browser (actions, screenshot, waitFor, mobile, profile, network, branding).","type":"boolean"},"proxy":{"description":"auto: basic first, enhanced once if the site refuses. basic: one plain attempt. enhanced: the stronger read from the start. stealth is the same as enhanced. Same price.","type":"string","enum":["auto","basic","enhanced","stealth"]},"storeInCache":{"default":true,"description":"Send false to neither read nor keep a stored copy of this page.","type":"boolean"},"lockdown":{"description":"Send true to answer only from a stored copy of the page and never read it live, whatever its age. A page with no stored copy is notFound. The same as minAge 0.","type":"boolean"},"checkPromptInjection":{"description":"Send true to scan the page text for instructions aimed at an AI model before anything is built from it. A page that has them is refused with 403 promptInjectionDetected and costs nothing. The scan adds $2.50 per 1,000 pages when it runs; a page it cannot scan fully comes back with a warning and no charge.","type":"boolean"},"redactPII":{"description":"Send true, or an object, to hide personal data in the markdown and in everything made from it (summary, answers, highlights, json). Links, html and rawHtml are not changed. A page the model cannot scan is refused rather than returned unredacted.","anyOf":[{"type":"boolean"},{"type":"object","properties":{"mode":{"default":"accurate","description":"accurate finds names and places with the model and the rest by pattern. aggressive adds guesses that catch more and may hide a little too much. fast uses patterns only, so it finds no ordinary names or places.","type":"string","enum":["accurate","aggressive","fast"]},"entities":{"default":["PERSON","EMAIL","PHONE","LOCATION","FINANCIAL","SECRET"],"description":"What to hide: PERSON, EMAIL, PHONE, LOCATION, FINANCIAL, SECRET. All by default.","minItems":1,"type":"array","items":{"type":"string","enum":["PERSON","EMAIL","PHONE","LOCATION","FINANCIAL","SECRET"]}},"replaceStyle":{"default":"tag","description":"tag writes <EMAIL>, mask writes * for each character, remove deletes it.","type":"string","enum":["tag","mask","remove"]}},"additionalProperties":false,"description":"Options for redactPII."}]},"profile":{"description":"Read the page with the cookies and local storage that earlier calls saved under this name, kept for your account for 30 days after the last use. A call with a profile always loads the page in a browser, costs $1 per 1,000 pages, the same as any page, and is never answered from a stored copy. Only one call at a time can save to a profile.","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128,"description":"A name you choose, such as shop-login. Calls with the same name share state."},"saveChanges":{"default":true,"description":"Keep the cookies and local storage this read leaves behind for the next call with this name. Send false to read with the profile without changing it.","type":"boolean"}},"required":["name"],"additionalProperties":false},"zeroDataRetention":{"default":false,"description":"Send true to keep nothing from this call: no stored copy is read or made, and nothing from it is logged. Adds $2 per 1,000 scraped URLs, not per PDF page. Not with a screenshot.","type":"boolean"}},"additionalProperties":false}},"required":["query"],"additionalProperties":false},"example":{"query":"nvidia earnings","sources":["web","news"],"limit":5}}}},"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"},"idempotent-replayed":{"$ref":"#/components/headers/IdempotentReplayed"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","additionalProperties":false,"properties":{"web":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"pages":{"description":"For a PDF read with the pdf parser and pages true: each page's markdown.","type":"array","items":{"type":"object","additionalProperties":false,"properties":{"pageNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"markdown":{"type":"string"}},"required":["pageNumber"]}},"blocks":{"description":"For a PDF read with the pdf parser and blocks true: each title, section header or run of text with its page, order, bbox and span.","type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/search.schema0"}}},"summary":{"description":"A short summary of the page.","type":"string"},"answer":{"description":"The answer to the question format. Left out, with a warning, when the page does not state one.","type":"string"},"product":{"description":"The product the page sells: title, brand, category, url, description and variants, each with its price, sale, availability and images. Left out, with a warning, when the page is not a product page.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"menu":{"description":"The menu on the page: isMenu, confidence, merchant, currency and sections with their items. Left out, with a warning, when the page is not a menu.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"html":{"type":"string"},"rawHtml":{"type":"string"},"audio":{"description":"A link to the audio of a YouTube video as an M4A file. The link works for 1 hour.","type":"string","format":"uri"},"video":{"description":"A link to a YouTube video as an MP4 file with sound, in the best single-file quality YouTube offers. The link works for 1 hour.","type":"string","format":"uri"},"rawBase64":{"description":"The bytes the site sent, Base64 encoded, without a data: prefix. metadata.contentType says what they are. Always read live.","type":"string"},"links":{"type":"array","items":{"type":"string"}},"images":{"type":"array","items":{"type":"string"}},"screenshot":{"description":"A link to a JPEG of the page. The link works for 7 days.","type":"string","format":"uri"},"screenshotCropped":{"description":"true when the page was taller than the screenshot, so the bottom is cut off.","type":"boolean"},"highlights":{"description":"The passages that best match the highlights query, best first.","type":"array","items":{"type":"object","additionalProperties":false,"properties":{"section":{"type":"string"},"text":{"type":"string"}},"required":[]}},"network":{"description":"The JSON responses the page loaded while it rendered, with their bodies.","type":"array","items":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string"},"method":{"type":"string"},"status":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contentType":{"type":"string"},"body":{"type":"string"}},"required":["status"]}},"branding":{"description":"The page's look: colorScheme, logo, colors (hex), fonts, typography, spacing, components, images and layout. Each field is left out or null when the page does not show it.","type":"object","additionalProperties":false,"properties":{"colorScheme":{"type":"string","enum":["light","dark"]},"logo":{"type":"string"},"colors":{"type":"object","additionalProperties":false,"properties":{"primary":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"secondary":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"accent":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"background":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"textPrimary":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"textSecondary":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"link":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"success":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"warning":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"error":{"type":"string","pattern":"^#[0-9a-f]{6}$"}},"required":[]},"fonts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"family":{"type":"string","minLength":1}},"required":["family"]}},"typography":{"type":"object","additionalProperties":false,"properties":{"fontFamilies":{"type":"object","additionalProperties":false,"properties":{"primary":{"type":"string","minLength":1},"heading":{"type":"string","minLength":1},"code":{"type":"string","minLength":1}},"required":[]},"fontSizes":{"type":"object","additionalProperties":false,"properties":{"h1":{"type":"string","minLength":1},"h2":{"type":"string","minLength":1},"h3":{"type":"string","minLength":1},"body":{"type":"string","minLength":1}},"required":[]},"fontWeights":{"type":"object","additionalProperties":false,"properties":{"light":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"regular":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"medium":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bold":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":[]},"lineHeights":{"type":"object","additionalProperties":false,"properties":{"heading":{"type":"string","minLength":1},"body":{"type":"string","minLength":1}},"required":[]}},"required":[]},"spacing":{"type":"object","additionalProperties":false,"properties":{"baseUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"borderRadius":{"type":"string","minLength":1},"padding":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}},"margins":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}}},"required":[]},"components":{"type":"object","additionalProperties":false,"properties":{"buttonPrimary":{"type":"object","additionalProperties":false,"properties":{"background":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"textColor":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"borderRadius":{"type":"string","minLength":1}},"required":[]},"buttonSecondary":{"type":"object","additionalProperties":false,"properties":{"background":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"textColor":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"borderColor":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"borderRadius":{"type":"string","minLength":1}},"required":[]},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}}},"required":[]},"icons":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}},"images":{"type":"object","additionalProperties":false,"properties":{"logo":{"type":"string"},"favicon":{"type":"string"},"ogImage":{"type":"string"}},"required":[]},"animations":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}},"layout":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}},"personality":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}}},"required":["colorScheme"]},"networkDropped":{"description":"How many JSON responses were left out because the page loaded too many or they were too big.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"json":{"description":"What you asked for with the json format. A page from a site Stophy reads natively, such as a Reddit post, comes back as its own data. Any other page comes back as the fields in your schema or prompt, each null when the page does not state it.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"changeTracking":{"description":"new the first time your key reads this page, same when nothing changed, changed with a unified diff of the markdown when something did. With json mode, json holds each field's previous and current value.","type":"object","additionalProperties":false,"properties":{"status":{"type":"string","enum":["new","same","changed"]},"previousAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"diff":{"type":"string"},"json":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","additionalProperties":false,"properties":{"previous":{"$ref":"#/components/schemas/search.schema0"},"current":{"$ref":"#/components/schemas/search.schema0"}},"required":[]}}},"required":["status"]},"attributes":{"description":"The values the attributes format read, one entry per selector.","type":"array","items":{"type":"object","additionalProperties":false,"properties":{"selector":{"type":"string"},"attribute":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":[]}},"actions":{"description":"What the screenshot, scrape, executeJavascript and pdf actions captured, each in the order the actions ran: screenshots and pdfs as links that work for 7 days, scrapes as the page url and html at that point, javascriptReturns as the type and value each script returned.","type":"object","additionalProperties":false,"properties":{"screenshots":{"type":"array","items":{"type":"string","format":"uri"}},"scrapes":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string"},"html":{"type":"string"}},"required":[]}},"javascriptReturns":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string"},"value":{}},"required":[]}},"pdfs":{"type":"array","items":{"type":"string","format":"uri"}}},"required":[]},"warning":{"description":"Set when an action failed: it names the action and says why. The rest of the answer is the page as it stood before that action. Also set when the site redirected the address to a page above it, such as a blog index for a removed post.","type":"string"},"url":{"type":"string","format":"uri"},"title":{"type":"string"},"description":{"type":"string"},"position":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"markdown":{"type":"string"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"array","items":{"type":"string"}}]}},"category":{"description":"What kind of page this is, when it is one of github, research or pdf.","type":"string","enum":["github","research","pdf"]},"date":{"description":"When the page was published or last updated, when known.","type":"string"}},"required":["url","position"]}},"news":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"pages":{"description":"For a PDF read with the pdf parser and pages true: each page's markdown.","type":"array","items":{"type":"object","additionalProperties":false,"properties":{"pageNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"markdown":{"type":"string"}},"required":["pageNumber"]}},"blocks":{"description":"For a PDF read with the pdf parser and blocks true: each title, section header or run of text with its page, order, bbox and span.","type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/search.schema0"}}},"summary":{"description":"A short summary of the page.","type":"string"},"answer":{"description":"The answer to the question format. Left out, with a warning, when the page does not state one.","type":"string"},"product":{"description":"The product the page sells: title, brand, category, url, description and variants, each with its price, sale, availability and images. Left out, with a warning, when the page is not a product page.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"menu":{"description":"The menu on the page: isMenu, confidence, merchant, currency and sections with their items. Left out, with a warning, when the page is not a menu.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"html":{"type":"string"},"rawHtml":{"type":"string"},"audio":{"description":"A link to the audio of a YouTube video as an M4A file. The link works for 1 hour.","type":"string","format":"uri"},"video":{"description":"A link to a YouTube video as an MP4 file with sound, in the best single-file quality YouTube offers. The link works for 1 hour.","type":"string","format":"uri"},"rawBase64":{"description":"The bytes the site sent, Base64 encoded, without a data: prefix. metadata.contentType says what they are. Always read live.","type":"string"},"links":{"type":"array","items":{"type":"string"}},"images":{"type":"array","items":{"type":"string"}},"screenshot":{"description":"A link to a JPEG of the page. The link works for 7 days.","type":"string","format":"uri"},"screenshotCropped":{"description":"true when the page was taller than the screenshot, so the bottom is cut off.","type":"boolean"},"highlights":{"description":"The passages that best match the highlights query, best first.","type":"array","items":{"type":"object","additionalProperties":false,"properties":{"section":{"type":"string"},"text":{"type":"string"}},"required":[]}},"network":{"description":"The JSON responses the page loaded while it rendered, with their bodies.","type":"array","items":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string"},"method":{"type":"string"},"status":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contentType":{"type":"string"},"body":{"type":"string"}},"required":["status"]}},"branding":{"description":"The page's look: colorScheme, logo, colors (hex), fonts, typography, spacing, components, images and layout. Each field is left out or null when the page does not show it.","type":"object","additionalProperties":false,"properties":{"colorScheme":{"type":"string","enum":["light","dark"]},"logo":{"type":"string"},"colors":{"type":"object","additionalProperties":false,"properties":{"primary":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"secondary":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"accent":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"background":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"textPrimary":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"textSecondary":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"link":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"success":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"warning":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"error":{"type":"string","pattern":"^#[0-9a-f]{6}$"}},"required":[]},"fonts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"family":{"type":"string","minLength":1}},"required":["family"]}},"typography":{"type":"object","additionalProperties":false,"properties":{"fontFamilies":{"type":"object","additionalProperties":false,"properties":{"primary":{"type":"string","minLength":1},"heading":{"type":"string","minLength":1},"code":{"type":"string","minLength":1}},"required":[]},"fontSizes":{"type":"object","additionalProperties":false,"properties":{"h1":{"type":"string","minLength":1},"h2":{"type":"string","minLength":1},"h3":{"type":"string","minLength":1},"body":{"type":"string","minLength":1}},"required":[]},"fontWeights":{"type":"object","additionalProperties":false,"properties":{"light":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"regular":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"medium":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bold":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":[]},"lineHeights":{"type":"object","additionalProperties":false,"properties":{"heading":{"type":"string","minLength":1},"body":{"type":"string","minLength":1}},"required":[]}},"required":[]},"spacing":{"type":"object","additionalProperties":false,"properties":{"baseUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"borderRadius":{"type":"string","minLength":1},"padding":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}},"margins":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}}},"required":[]},"components":{"type":"object","additionalProperties":false,"properties":{"buttonPrimary":{"type":"object","additionalProperties":false,"properties":{"background":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"textColor":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"borderRadius":{"type":"string","minLength":1}},"required":[]},"buttonSecondary":{"type":"object","additionalProperties":false,"properties":{"background":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"textColor":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"borderColor":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"borderRadius":{"type":"string","minLength":1}},"required":[]},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}}},"required":[]},"icons":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}},"images":{"type":"object","additionalProperties":false,"properties":{"logo":{"type":"string"},"favicon":{"type":"string"},"ogImage":{"type":"string"}},"required":[]},"animations":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}},"layout":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}},"personality":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}}},"required":["colorScheme"]},"networkDropped":{"description":"How many JSON responses were left out because the page loaded too many or they were too big.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"json":{"description":"What you asked for with the json format. A page from a site Stophy reads natively, such as a Reddit post, comes back as its own data. Any other page comes back as the fields in your schema or prompt, each null when the page does not state it.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"changeTracking":{"description":"new the first time your key reads this page, same when nothing changed, changed with a unified diff of the markdown when something did. With json mode, json holds each field's previous and current value.","type":"object","additionalProperties":false,"properties":{"status":{"type":"string","enum":["new","same","changed"]},"previousAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"diff":{"type":"string"},"json":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","additionalProperties":false,"properties":{"previous":{"$ref":"#/components/schemas/search.schema0"},"current":{"$ref":"#/components/schemas/search.schema0"}},"required":[]}}},"required":["status"]},"attributes":{"description":"The values the attributes format read, one entry per selector.","type":"array","items":{"type":"object","additionalProperties":false,"properties":{"selector":{"type":"string"},"attribute":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":[]}},"actions":{"description":"What the screenshot, scrape, executeJavascript and pdf actions captured, each in the order the actions ran: screenshots and pdfs as links that work for 7 days, scrapes as the page url and html at that point, javascriptReturns as the type and value each script returned.","type":"object","additionalProperties":false,"properties":{"screenshots":{"type":"array","items":{"type":"string","format":"uri"}},"scrapes":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string"},"html":{"type":"string"}},"required":[]}},"javascriptReturns":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string"},"value":{}},"required":[]}},"pdfs":{"type":"array","items":{"type":"string","format":"uri"}}},"required":[]},"warning":{"description":"Set when an action failed: it names the action and says why. The rest of the answer is the page as it stood before that action. Also set when the site redirected the address to a page above it, such as a blog index for a removed post.","type":"string"},"title":{"type":"string"},"url":{"type":"string","format":"uri"},"snippet":{"type":"string"},"date":{"type":"string"},"imageUrl":{"type":"string","format":"uri"},"position":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"markdown":{"type":"string"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"array","items":{"type":"string"}}]}}},"required":["url","position"]}},"images":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"title":{"type":"string"},"imageUrl":{"type":"string","format":"uri"},"imageWidth":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"imageHeight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string","format":"uri"},"position":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["imageUrl","imageWidth","imageHeight","url","position"]}},"research":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri","description":"The paper's DOI link, or its OpenAlex page when it has no DOI."},"doi":{"type":"string"},"snippet":{"description":"The part of the abstract that best matches the query.","type":"string"},"authors":{"type":"array","items":{"type":"string"},"description":"Up to the first 10 authors."},"year":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"venue":{"description":"The journal, conference or repository.","type":"string"},"type":{"description":"article, preprint, review, book-chapter and so on.","type":"string"},"citedByCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"openAccessUrl":{"description":"A free copy of the paper, when one exists.","type":"string","format":"uri"},"position":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["url","citedByCount","position"]}},"videos":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string","format":"uri","description":"Watch link. It carries &t= when Stophy knows where in the video the snippet is said."},"title":{"type":"string"},"channel":{"type":"string"},"channelUrl":{"type":"string","format":"uri"},"publishedAt":{"description":"Approximate: YouTube lists show only how long ago a video was published.","type":"string"},"durationSeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"views":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"snippet":{"description":"A passage that matches the query, as spoken, when Stophy holds the captions.","type":"string"},"startSeconds":{"description":"Where the snippet starts, in seconds, when it is known exactly.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["url","position"]}}},"required":[]},"warning":{"type":"string"}},"required":["success"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/scrape":{"post":{"operationId":"scrape","summary":"Scrape any public web page as markdown, HTML, links, a screenshot or JSON","description":"Costs $1 per 1,000 pages, however they are reached. checkPromptInjection adds $2.50 per 1,000 pages when the scan runs, json with a schema or a prompt, summary, highlights, question, product, menu and changeTracking in json mode add $3 per 1,000 pages each when they return something. CSS rules and attributes add nothing. A named parser uses its own price. Any page read or other paid format you ask for is charged separately. A PDF adds $0.50 per 1,000 pages of text from its text layer and $2.50 per 1,000 pages of text read from its picture that come back, so a PDF read with maxChars, offset or query is charged for the share of its pages that it returns, at least 1 page. Browser actions add nothing. An answer from a stored copy within maxAge costs $1 per 1,000 pages like any page. An unreadable page costs nothing. The base page price is waived for a readable 404 or 410. zeroDataRetention adds $2 per 1,000 scraped URLs, not per PDF page. A page that comes back with an error status does not incur the zeroDataRetention surcharge. metadata.costUsd shows what the call cost in dollars. Works without an API key, within free limits.","security":[{},{"apiKey":[]}],"x-credits":1,"x-credits-max":59,"x-cost-usd":0.001,"x-cost-usd-max":0.1165,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"description":"The page or PDF to read, such as https://bun.com/docs.","type":"string"},"formats":{"description":"What to return: markdown (clean page text), summary (a short summary of the page), html (the cleaned page), rawHtml (the page as sent), audio and video (for a YouTube link: the audio track as an M4A file, or the video as an MP4 file, as a link that works for 1 hour), rawBase64 (the bytes the site sent, Base64 encoded, from a live read; metadata.contentType says what they are; the address of a picture such as a PNG or JPEG is read only with rawBase64 as the only format), links (every link on the page), images (every image address), screenshot (a link to a JPEG of the visible page, kept for 7 days), changeTracking (what changed in the markdown since your key last read this page with the same options, kept 30 days; add modes [\"git-diff\",\"json\"] with a schema or prompt to compare fields too), question (send { \"type\": \"question\", \"question\": \"...\" } to get answer, left out with a warning when the page does not state one), product (title, brand, category, url, description and variants with price, sale, availability and images, left out with a warning when there is none) and menu (merchant, currency and sections of items with prices, left out with a warning when there is none) network (the JSON the page loaded while it rendered, up to 30 responses) and branding (the page's colors, fonts, typography, spacing, button and input styles, logo and brand images, read from how the page looks, with a field left out when the page does not show it). Send { \"type\": \"screenshot\", \"fullPage\": true } for the whole page. Send { \"type\": \"highlights\", \"query\": \"refund policy\" } for the passages that best match a query. Send { \"type\": \"json\", \"schema\": { \"type\": \"object\", \"properties\": { \"price\": { \"type\": \"number\" } } } } or { \"type\": \"json\", \"prompt\": \"the price and the stock\" } for fields filled from the page, each checked against it. Send { \"type\": \"json\", \"parser\": \"amazon-product\" } to get a site's own data as json instead of reading the page; GET /v1/parsers lists the parsers. Send { \"type\": \"json\", \"rules\": { \"title\": \"h1\", \"links\": { \"selector\": \"a\", \"type\": \"list\", \"output\": \"@href\" } } } to read the page with CSS rules and no model, at the page's own price. Send { \"type\": \"attributes\", \"selectors\": [{ \"selector\": \"a\", \"attribute\": \"href\" }] } for attribute values, returned in attributes. Without a parser or rules, json needs a schema or a prompt and is filled from the page. json with a schema or a prompt, summary, highlights, question, product, menu and changeTracking in json mode add $3 per 1,000 pages each when they return something. JSON with CSS rules and attributes add nothing. A named parser uses its own price. Any page read or other paid format you ask for is charged separately. A screenshot, network or branding read costs $1 per 1,000 pages, the same as any page. A PDF comes back as markdown only, and adds $0.50 per 1,000 pages of text from its text layer and $2.50 per 1,000 pages of text read from its picture that comes back. A CSV or an Excel .xlsx file comes back as markdown tables.","default":["markdown"],"minItems":1,"maxItems":20,"type":"array","items":{"anyOf":[{"type":"string","enum":["markdown","summary","html","rawHtml","rawBase64","links","images","network","branding","audio","video","screenshot","changeTracking","product","menu"]},{"type":"object","properties":{"type":{"type":"string","enum":["markdown","summary","html","rawHtml","rawBase64","links","images","network","branding","audio","video"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"changeTracking"},"modes":{"description":"git-diff returns a unified diff of the markdown. json compares the fields in schema or prompt between this read and the last one. Without modes you get git-diff.","maxItems":2,"type":"array","items":{"type":"string","enum":["git-diff","json"]}},"schema":{"description":"The fields to fill, as a JSON Schema (draft-07 or 2020-12) object with properties. Pydantic's model_json_schema() and zod's toJSONSchema() output work as they are. enum, const, anyOf, oneOf, nullable types, $ref with $defs, required, descriptions and any key names are read. Up to 100 top-level fields and 32 KB. A field the page does not state comes back null.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/scrape.input.schema0"}},"prompt":{"description":"With json mode: what to compare, in plain words, such as the price and stock.","type":"string","minLength":1,"maxLength":10000},"tag":{"type":"null"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"question"},"question":{"type":"string","minLength":1,"maxLength":10000,"description":"A question to answer from the page, such as what the refund window is."}},"required":["type","question"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"product"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"menu"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"screenshot"},"fullPage":{"default":false,"description":"Capture the whole page from top to bottom instead of the visible part.","type":"boolean"},"quality":{"description":"JPEG quality from 1 to 100. The default is 70.","type":"integer","minimum":1,"maximum":100},"viewport":{"description":"The window size in pixels, such as { width: 390, height: 844 }.","type":"object","properties":{"width":{"type":"integer","minimum":200,"maximum":3840},"height":{"type":"integer","minimum":200,"maximum":2160}},"required":["width","height"],"additionalProperties":false}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"highlights"},"query":{"type":"string","minLength":1,"maxLength":10000,"description":"What you are looking for on the page, such as refund policy."},"count":{"default":5,"description":"How many passages to return, best match first.","type":"integer","minimum":1,"maximum":20}},"required":["type","query"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"json"},"parser":{"description":"Read the page with a named parser, which gives the site's own data as json. The url must be the kind of page the parser reads. Parsers are the only way to read some sites. GET /v1/parsers lists them.","type":"string"},"options":{"description":"Only with parser: extra inputs for it, such as { \"page\": 2 } for the next page of results or { \"minRating\": 4.5 } for a filter. GET /v1/parsers lists what each parser accepts.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/scrape.input.schema1"}},"schema":{"description":"The fields to fill, as a JSON Schema (draft-07 or 2020-12) object with properties. Pydantic's model_json_schema() and zod's toJSONSchema() output work as they are. enum, const, anyOf, oneOf, nullable types, $ref with $defs, required, descriptions and any key names are read. Up to 100 top-level fields and 32 KB. A field the page does not state comes back null.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/scrape.input.schema0"}},"prompt":{"description":"What to pull from the page in plain words, such as the version and the release date.","type":"string","minLength":1,"maxLength":10000},"rules":{"description":"Read the page with CSS rules instead of a model, no extra fee. Each field is a selector such as \"h1\" (the first match's text), \"a@href\" (an attribute) or { \"selector\": \"li\", \"type\": \"list\", \"output\": \"text\" | \"html\" | \"@attribute\" | { nested fields } }. A missing item is null and an unmatched list is []. Relative links become absolute. Up to 100 fields, 5 levels deep. Not with schema, prompt or parser.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/scrape.input.schema2"}},"checkPromptInjection":{"description":"Deprecated: send checkPromptInjection at the top level of the call.","type":"boolean"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"attributes"},"selectors":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"selector":{"type":"string","minLength":1},"attribute":{"type":"string","minLength":1,"maxLength":100}},"required":["selector","attribute"],"additionalProperties":false},"description":"The elements and attributes to read, such as { selector: 'a.buy', attribute: 'href' }."}},"required":["type","selectors"],"additionalProperties":false}]}},"onlyMainContent":{"default":true,"description":"Keep only the page's main content, without menus, headers, footers and ads.","type":"boolean"},"onlyCleanContent":{"description":"Send true to have a model remove what onlyMainContent leaves behind in the markdown: cookie banners, ads, share widgets, breadcrumbs, sign-up prompts, comment prompts and related-article lists. It only removes whole paragraphs and lists; it never rewrites or adds text, and code blocks are always kept. Skipped with a warning when the page is too long to clean or the model does not answer. Not with zeroDataRetention. Summary, answers and highlights are made from the cleaned markdown.","type":"boolean"},"includeTags":{"description":"Keep only the parts of the page that match these CSS selectors, such as article or .price. When set, onlyMainContent is not applied.","minItems":1,"type":"array","items":{"type":"string","minLength":1}},"excludeTags":{"description":"Remove the parts of the page that match these CSS selectors, such as .comments.","minItems":1,"type":"array","items":{"type":"string","minLength":1}},"maxAge":{"description":"Accept a stored answer up to this many milliseconds old, at most 30 days. Without it, 2 days, or less for a site whose pages change often, and a copy up to twice that age (at most 7 days) comes back at once as stale while a fresh read runs. 0 always reads the page live. metadata.cacheState says which one you got.","type":"integer","minimum":0,"maximum":9007199254740991},"minAge":{"description":"Answer only from a stored copy that is at least this many milliseconds old, and never read the page live. 0 accepts any stored copy. A page with no such copy is notFound.","type":"integer","minimum":0,"maximum":9007199254740991},"headers":{"description":"Extra request headers to send to the site, such as { \"x-plan\": \"pro\" }. A read with headers is never answered from or saved to a stored copy.","type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9-]{1,64}$"},"additionalProperties":{"type":"string","maxLength":2000,"pattern":"^[\\t\\x20-\\x7e]*$"}},"waitFor":{"description":"Extra milliseconds to wait before reading, up to 60000, for pages that load their content late. To wait for an element, add a wait action with a selector. A read that waits costs $1 per 1,000 pages, the same as any page.","type":"integer","minimum":0,"maximum":60000},"mobile":{"description":"Read the page as a phone would: a phone-sized screen and the mobile version of the site. The page loads in a browser.","type":"boolean"},"skipTlsVerification":{"description":"Send true to read a page whose certificate is expired, self-signed or for another name. The read is not private against someone between us and the site.","type":"boolean"},"timeout":{"default":60000,"description":"How long to keep trying, in milliseconds, from 1 second to 5 minutes; 60 seconds by default. A page that needs a browser needs at least 5 seconds, and pages behind a bot check can need 10 to 30 seconds the first time. A read that runs out of time is an error and costs nothing.","type":"integer","minimum":1000,"maximum":300000},"parsers":{"description":"Only the pdf parser exists. Send \"pdf\" or { \"type\": \"pdf\", mode, maxPages, pages, blocks, pageMarkers } with the same meaning as in parse. Without mode a PDF is read as auto: from its text layer, and from the picture of any page that has no text. fast reads the text layer only, and ocr reads the picture of every page, up to 20 pages. Each page of text that comes back costs $0.50 per 1,000 pages from its text layer and $2.50 per 1,000 pages from its picture. Pictures are read only with an API key.","minItems":1,"type":"array","items":{"anyOf":[{"type":"string","const":"pdf"},{"type":"object","properties":{"type":{"type":"string","const":"pdf"},"mode":{"description":"fast reads the text layer only. auto (the default) reads the text layer and reads the picture of any page that has none. ocr reads the picture of every page.","type":"string","enum":["fast","auto","ocr"]},"maxPages":{"description":"Read at most this many pages, up to 500, which is also the default.","type":"integer","minimum":1,"maximum":500},"pages":{"description":"Send true to also get each page's markdown in pages, as { pageNumber, markdown }. No extra charge.","type":"boolean"},"blocks":{"description":"Send true to also get the page's layout in blocks: each title, section header or run of text, with its page, reading order, position on the page (bbox as left, top, right, bottom from 0 to 1) and where its text sits in that page's markdown (span, as in pages). Tables, figures and formulas are not told apart. A page read from its picture is one block. No extra charge.","type":"boolean"},"pageMarkers":{"description":"Send true to mark page breaks in the markdown: pages are joined with \"---\" and a <!-- page N --> line, where N is the page that follows. No extra charge.","type":"boolean"}},"required":["type"],"additionalProperties":false}]}},"actions":{"description":"Up to 50 steps to run on the page, in order, before reading it: { \"type\": \"wait\", \"milliseconds\": 500 } (up to 60 seconds), { \"type\": \"wait\", \"selector\": \".results\" }, { \"type\": \"click\", \"selector\": \"button.more\" }, { \"type\": \"write\", \"text\": \"tides\" }, { \"type\": \"press\", \"key\": \"Enter\" }, { \"type\": \"scroll\", \"direction\": \"down\" } (also up, left or right; amount is pixels, \"viewport\" or \"max\"; maxScrolls 1 to 50; selector scrolls an inner container; \"max\" keeps scrolling until the page stops growing, for feeds that load as you go), { \"type\": \"screenshot\", \"fullPage\": true } (links come back in actions.screenshots), { \"type\": \"scrape\" } (the page at that point, in actions.scrapes), { \"type\": \"executeJavascript\", \"script\": \"document.title\" } (results in actions.javascriptReturns), { \"type\": \"pdf\", \"format\": \"A4\" } (links in actions.pdfs) or { \"type\": \"perform\", \"action\": \"Click the Load more button\" } (a step in plain words, up to 5 browser steps on this page, never leaving the site; at most 5 per call). A read with actions costs $1 per 1,000 pages, the same as any page; the actions themselves add nothing. If an action fails, you still get the page as it stood, with a warning that names the action and says why.","minItems":1,"maxItems":50,"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"wait"},"milliseconds":{"type":"integer","minimum":1,"maximum":60000}},"required":["type","milliseconds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"wait"},"selector":{"type":"string","minLength":1}},"required":["type","selector"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"click"},"selector":{"type":"string","minLength":1},"all":{"type":"boolean","const":false}},"required":["type","selector"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"write"},"text":{"type":"string","minLength":1}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"press"},"key":{"type":"string","minLength":1,"maxLength":40}},"required":["type","key"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"scroll"},"direction":{"default":"down","type":"string","enum":["up","down","left","right"]},"amount":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"string","enum":["viewport","max"]}]},"maxScrolls":{"type":"integer","minimum":1,"maximum":50},"selector":{"type":"string","minLength":1}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"screenshot"},"fullPage":{"type":"boolean"},"quality":{"type":"integer","minimum":1,"maximum":100},"viewport":{"type":"object","properties":{"width":{"type":"integer","minimum":200,"maximum":3840},"height":{"type":"integer","minimum":200,"maximum":2160}},"required":["width","height"],"additionalProperties":false}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"scrape"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"executeJavascript"},"script":{"type":"string","minLength":1,"maxLength":20000}},"required":["type","script"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"pdf"},"format":{"type":"string","enum":["Letter","Legal","Tabloid","Ledger","A0","A1","A2","A3","A4","A5","A6"]},"landscape":{"type":"boolean"},"scale":{"type":"number","minimum":0.1,"maximum":2}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"perform"},"action":{"type":"string","minLength":1,"maxLength":500}},"required":["type","action"],"additionalProperties":false}]}},"location":{"description":"Where to read the page from. The default is the United States.","type":"object","properties":{"country":{"description":"Two-letter country code to read the page from, such as DE or JP.","type":"string"},"languages":{"description":"Languages to ask the site for, best first, such as [\"de\", \"en\"]. Sent as Accept-Language. A read with languages is never answered from or saved to a stored copy.","minItems":1,"maxItems":5,"type":"array","items":{"type":"string","pattern":"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$"}}},"additionalProperties":false},"removeBase64Images":{"description":"Images inside the page that carry their data in the address (data:image) are dropped by default. Send false to keep them in markdown and html.","type":"boolean"},"blockAds":{"description":"Ads and trackers are not loaded when a page runs in a browser. Send false to load them.","type":"boolean"},"fastMode":{"description":"Send true to read the page without opening a browser: the answer comes sooner, but a page that needs a browser, or that refuses a plain request, comes back as an error instead of being retried. Ignored when the call needs a browser (actions, screenshot, waitFor, mobile, profile, network, branding).","type":"boolean"},"proxy":{"description":"auto: basic first, enhanced once if the site refuses. basic: one plain attempt. enhanced: the stronger read from the start. stealth is the same as enhanced. Same price.","type":"string","enum":["auto","basic","enhanced","stealth"]},"storeInCache":{"default":true,"description":"Send false to neither read nor keep a stored copy of this page.","type":"boolean"},"lockdown":{"description":"Send true to answer only from a stored copy of the page and never read it live, whatever its age. A page with no stored copy is notFound. The same as minAge 0.","type":"boolean"},"checkPromptInjection":{"description":"Send true to scan the page text for instructions aimed at an AI model before anything is built from it. A page that has them is refused with 403 promptInjectionDetected and costs nothing. The scan adds $2.50 per 1,000 pages when it runs; a page it cannot scan fully comes back with a warning and no charge.","type":"boolean"},"redactPII":{"description":"Send true, or an object, to hide personal data in the markdown and in everything made from it (summary, answers, highlights, json). Links, html and rawHtml are not changed. A page the model cannot scan is refused rather than returned unredacted.","anyOf":[{"type":"boolean"},{"type":"object","properties":{"mode":{"default":"accurate","description":"accurate finds names and places with the model and the rest by pattern. aggressive adds guesses that catch more and may hide a little too much. fast uses patterns only, so it finds no ordinary names or places.","type":"string","enum":["accurate","aggressive","fast"]},"entities":{"default":["PERSON","EMAIL","PHONE","LOCATION","FINANCIAL","SECRET"],"description":"What to hide: PERSON, EMAIL, PHONE, LOCATION, FINANCIAL, SECRET. All by default.","minItems":1,"type":"array","items":{"type":"string","enum":["PERSON","EMAIL","PHONE","LOCATION","FINANCIAL","SECRET"]}},"replaceStyle":{"default":"tag","description":"tag writes <EMAIL>, mask writes * for each character, remove deletes it.","type":"string","enum":["tag","mask","remove"]}},"additionalProperties":false,"description":"Options for redactPII."}]},"profile":{"description":"Read the page with the cookies and local storage that earlier calls saved under this name, kept for your account for 30 days after the last use. A call with a profile always loads the page in a browser, costs $1 per 1,000 pages, the same as any page, and is never answered from a stored copy. Only one call at a time can save to a profile.","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128,"description":"A name you choose, such as shop-login. Calls with the same name share state."},"saveChanges":{"default":true,"description":"Keep the cookies and local storage this read leaves behind for the next call with this name. Send false to read with the profile without changing it.","type":"boolean"}},"required":["name"],"additionalProperties":false},"zeroDataRetention":{"default":false,"description":"Send true to keep nothing from this call: no stored copy is read or made, and nothing from it is logged. Adds $2 per 1,000 scraped URLs, not per PDF page. Not with a screenshot.","type":"boolean"},"linkStyle":{"default":"inline","description":"How links appear in the markdown. inline keeps [text](address). numbered writes Pricing⟨3⟩ and lists each address once at the end. none keeps only the link text, which makes link-heavy pages 10 to 70% shorter; ask for the links format to get the addresses.","type":"string","enum":["inline","numbered","none"]},"maxChars":{"description":"Cut the markdown at this many characters; isTruncated says when that happened and nextOffset where to read on. With query, how much of the page to keep, 8000 by default.","type":"integer","minimum":500,"maximum":1000000},"offset":{"description":"Start the markdown this many characters into the page, PDF or file. Send the nextOffset of the last answer, with the same maxChars, to read on. Not with query.","type":"integer","minimum":0,"maximum":9007199254740991},"query":{"description":"What you are looking for on the page, such as refund window. A page longer than maxChars (8000 by default) comes back as the passages that match, in page order, each with the text around it and its table header; a shorter page comes back whole. Costs nothing extra, and a PDF is charged for the share of its pages that comes back. Not with offset.","type":"string","minLength":1,"maxLength":10000},"urls":{"not":{}}},"required":["url"],"additionalProperties":false},"example":{"url":"https://bun.com/docs/runtime/bunfig"}}}},"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"},"idempotent-replayed":{"$ref":"#/components/headers/IdempotentReplayed"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","additionalProperties":false,"properties":{"markdown":{"type":"string"},"summary":{"type":"string"},"html":{"type":"string"},"rawHtml":{"type":"string"},"links":{"type":"array","items":{"type":"string"}},"images":{"type":"array","items":{"type":"string"}},"attributes":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"selector":{"type":"string"},"attribute":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":[]}},"screenshot":{"type":"string"},"json":{"$ref":"#/components/schemas/scrape.schema0"},"highlights":{"type":"string"},"isTruncated":{"type":"boolean"},"nextOffset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"changeTracking":{"type":"object","additionalProperties":false,"properties":{"previousScrapeAt":{"type":"string"},"changeStatus":{"type":"string","enum":["new","same","changed"]},"visibility":{"type":"string"},"diff":{"type":"string"}},"required":[]},"branding":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/scrape.schema0"}},"actions":{"type":"object","additionalProperties":false,"properties":{"screenshots":{"type":"array","items":{"type":"string"}},"scrapes":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string"},"html":{"type":"string"}},"required":[]}},"javascriptReturns":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string"},"value":{"$ref":"#/components/schemas/scrape.schema0"}},"required":[]}},"pdfs":{"type":"array","items":{"type":"string"}}},"required":[]},"warning":{"type":"string"},"metadata":{"type":"object","additionalProperties":{},"description":"Facts about the page. Named page facts such as ogTitle or keywords appear when the page has them, and every meta tag also appears under its own name, such as og:title.","properties":{"title":{"type":"string"},"description":{"type":"string"},"language":{"type":"string"},"ogImage":{"type":"string"},"sourceURL":{"type":"string"},"url":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contentType":{"type":"string"},"numPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cacheState":{"type":"string","enum":["hit","miss","stale"]},"cachedAt":{"type":"string"},"scrapeId":{"type":"string"},"costUsd":{"type":"number"}},"required":["statusCode"]}},"required":["isTruncated","metadata"]}},"required":["success","data"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/extract":{"post":{"operationId":"extract","summary":"Pull the fields you name from any public page as JSON, each checked against the page","description":"Costs $5 per 1,000 pages for most pages: the page's own price plus $4 per 1,000 pages. Each page after the first costs $1 per 1,000 pages more, and a long answer costs $1 per 1,000 pages more for every 64 values after the first 64, for each 40000 characters of page text read. A call that finds none of the fields is free. The catalog estimate is for ordinary pages, not a spending limit for PDF reads or other add-ons.","x-credits":3,"x-credits-max":48,"x-cost-usd":0.005,"x-cost-usd-max":0.095,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"urls":{"default":[],"description":"The pages to read, up to 25, such as [\"https://bun.com/blog/bun-v1.3\"]. An address ending in /* reads pages under it, found through the site's sitemap. With more than one, the fields are filled from all of them together. A page that cannot be read is skipped and named in warning, and costs nothing. A page is read up to 50000 characters. With several pages each one gets a smaller share, and all together are read up to 150000 characters. A page that is cut is counted in warning. The call fails only when no page can be read. Leave it out and send a prompt to search the web instead.","maxItems":25,"type":"array","items":{"type":"string","maxLength":2048}},"schema":{"description":"The fields to fill, as a JSON Schema (draft-07 or 2020-12) object with properties. Pydantic's model_json_schema() and zod's toJSONSchema() output work as they are. enum, const, anyOf, oneOf, nullable types, $ref with $defs, required, descriptions and any key names are read. Up to 100 top-level fields and 32 KB. A field the page does not state comes back null.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/extract.input.schema0"}},"prompt":{"description":"What to pull from the pages in plain words, such as the version and the release date, up to 10000 characters. With no urls, the web is searched for the first 400 characters of it.","type":"string","minLength":1,"maxLength":10000},"systemPrompt":{"description":"Standing instructions for how to fill the fields, such as units or how to write dates, up to 10000 characters. They add to the rules of the extract: a value is still copied from the page and is null when the page does not state it.","type":"string","minLength":1,"maxLength":10000},"enableWebSearch":{"default":false,"description":"Send true to also search the web for your prompt and read the best pages it finds, up to 3 more. Needs a prompt. The search costs $1 per 1,000 searches. With no urls, the search runs without this.","type":"boolean"},"allowExternalLinks":{"default":false,"description":"Send true to also read pages on other sites that the pages link to, up to 5, picking the links whose address mentions your prompt. Each page read costs $1 per 1,000 pages.","type":"boolean"},"agent":{"description":"Accepted so a client that sends an agent model works. The value is not used. An extract reads the pages it is given and checks every value; it does not browse or click, and the answer says so in warning. To navigate a site, use the agent endpoint.","type":"object","properties":{"model":{"type":"string","minLength":1,"maxLength":40}},"required":["model"],"additionalProperties":false},"webhook":{"description":"Where to be told when the extract ends: a plain address, or { url } which gets one JSON POST with the id, the status, the data and costUsd. headers are sent with the call, metadata comes back in it, and events picks completed, failed or both (both by default). The call is signed: read Stophy-Signature (t=<unix seconds>,v1=<hex>), the HMAC-SHA256 of \"<t>.<body>\" with your webhook secret from webhook.secret. A call that gets no 2xx is sent again, up to 3 times. Every call has an eventId that stays the same when the call is sent again, so you can skip one you already handled.","anyOf":[{"type":"string"},{"type":"object","properties":{"url":{"type":"string"},"headers":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9-]{1,64}$"},"additionalProperties":{"type":"string","maxLength":1000}},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/extract.input.schema0"}},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["started","page","action","completed","failed","cancelled"]}}},"required":["url"],"additionalProperties":false}]},"ignoreSitemap":{"default":false,"description":"For an address ending in /*: skip the site's sitemaps and find pages by links.","type":"boolean"},"includeSubdomains":{"default":true,"description":"For an address ending in /*: also read pages on subdomains of the site. Send false to stay on the exact host.","type":"boolean"},"limit":{"description":"For an address ending in /*: read at most this many pages under it. At most 25 pages are read in all.","type":"integer","minimum":1,"maximum":9007199254740991},"timeout":{"default":30000,"description":"How long to keep reading the pages, in milliseconds, from 1 second to 5 minutes; 30 seconds by default. A page not read by then is skipped and named in warning, and costs nothing.","type":"integer","minimum":1000,"maximum":300000},"showSources":{"default":false,"description":"Send true to get sources: for each field, the pages that state its value.","type":"boolean"},"scrapeOptions":{"description":"How to read each page, the same options as scrape.","type":"object","properties":{"onlyMainContent":{"default":true,"description":"Keep only the page's main content, without menus, headers, footers and ads.","type":"boolean"},"onlyCleanContent":{"description":"Send true to have a model remove what onlyMainContent leaves behind in the markdown: cookie banners, ads, share widgets, breadcrumbs, sign-up prompts, comment prompts and related-article lists. It only removes whole paragraphs and lists; it never rewrites or adds text, and code blocks are always kept. Skipped with a warning when the page is too long to clean or the model does not answer. Not with zeroDataRetention. Summary, answers and highlights are made from the cleaned markdown.","type":"boolean"},"includeTags":{"description":"Keep only the parts of the page that match these CSS selectors, such as article or .price. When set, onlyMainContent is not applied.","minItems":1,"type":"array","items":{"type":"string","minLength":1}},"excludeTags":{"description":"Remove the parts of the page that match these CSS selectors, such as .comments.","minItems":1,"type":"array","items":{"type":"string","minLength":1}},"maxAge":{"description":"Accept a stored answer up to this many milliseconds old, at most 30 days. Without it, 2 days, or less for a site whose pages change often, and a copy up to twice that age (at most 7 days) comes back at once as stale while a fresh read runs. 0 always reads the page live. metadata.cacheState says which one you got.","type":"integer","minimum":0,"maximum":9007199254740991},"minAge":{"description":"Answer only from a stored copy that is at least this many milliseconds old, and never read the page live. 0 accepts any stored copy. A page with no such copy is notFound.","type":"integer","minimum":0,"maximum":9007199254740991},"headers":{"description":"Extra request headers to send to the site, such as { \"x-plan\": \"pro\" }. A read with headers is never answered from or saved to a stored copy.","type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9-]{1,64}$"},"additionalProperties":{"type":"string","maxLength":2000,"pattern":"^[\\t\\x20-\\x7e]*$"}},"waitFor":{"description":"Extra milliseconds to wait before reading, up to 60000, for pages that load their content late. To wait for an element, add a wait action with a selector. A read that waits costs $1 per 1,000 pages, the same as any page.","type":"integer","minimum":0,"maximum":60000},"mobile":{"description":"Read the page as a phone would: a phone-sized screen and the mobile version of the site. The page loads in a browser.","type":"boolean"},"skipTlsVerification":{"description":"Send true to read a page whose certificate is expired, self-signed or for another name. The read is not private against someone between us and the site.","type":"boolean"},"timeout":{"default":60000,"description":"How long to keep trying, in milliseconds, from 1 second to 5 minutes; 60 seconds by default. A page that needs a browser needs at least 5 seconds, and pages behind a bot check can need 10 to 30 seconds the first time. A read that runs out of time is an error and costs nothing.","type":"integer","minimum":1000,"maximum":300000},"parsers":{"description":"Only the pdf parser exists. Send \"pdf\" or { \"type\": \"pdf\", mode, maxPages, pages, blocks, pageMarkers } with the same meaning as in parse. Without mode a PDF is read as auto: from its text layer, and from the picture of any page that has no text. fast reads the text layer only, and ocr reads the picture of every page, up to 20 pages. Each page of text that comes back costs $0.50 per 1,000 pages from its text layer and $2.50 per 1,000 pages from its picture. Pictures are read only with an API key.","minItems":1,"type":"array","items":{"anyOf":[{"type":"string","const":"pdf"},{"type":"object","properties":{"type":{"type":"string","const":"pdf"},"mode":{"description":"fast reads the text layer only. auto (the default) reads the text layer and reads the picture of any page that has none. ocr reads the picture of every page.","type":"string","enum":["fast","auto","ocr"]},"maxPages":{"description":"Read at most this many pages, up to 500, which is also the default.","type":"integer","minimum":1,"maximum":500},"pages":{"description":"Send true to also get each page's markdown in pages, as { pageNumber, markdown }. No extra charge.","type":"boolean"},"blocks":{"description":"Send true to also get the page's layout in blocks: each title, section header or run of text, with its page, reading order, position on the page (bbox as left, top, right, bottom from 0 to 1) and where its text sits in that page's markdown (span, as in pages). Tables, figures and formulas are not told apart. A page read from its picture is one block. No extra charge.","type":"boolean"},"pageMarkers":{"description":"Send true to mark page breaks in the markdown: pages are joined with \"---\" and a <!-- page N --> line, where N is the page that follows. No extra charge.","type":"boolean"}},"required":["type"],"additionalProperties":false}]}},"actions":{"description":"Up to 50 steps to run on the page, in order, before reading it: { \"type\": \"wait\", \"milliseconds\": 500 } (up to 60 seconds), { \"type\": \"wait\", \"selector\": \".results\" }, { \"type\": \"click\", \"selector\": \"button.more\" }, { \"type\": \"write\", \"text\": \"tides\" }, { \"type\": \"press\", \"key\": \"Enter\" }, { \"type\": \"scroll\", \"direction\": \"down\" } (also up, left or right; amount is pixels, \"viewport\" or \"max\"; maxScrolls 1 to 50; selector scrolls an inner container; \"max\" keeps scrolling until the page stops growing, for feeds that load as you go), { \"type\": \"screenshot\", \"fullPage\": true } (links come back in actions.screenshots), { \"type\": \"scrape\" } (the page at that point, in actions.scrapes), { \"type\": \"executeJavascript\", \"script\": \"document.title\" } (results in actions.javascriptReturns), { \"type\": \"pdf\", \"format\": \"A4\" } (links in actions.pdfs) or { \"type\": \"perform\", \"action\": \"Click the Load more button\" } (a step in plain words, up to 5 browser steps on this page, never leaving the site; at most 5 per call). A read with actions costs $1 per 1,000 pages, the same as any page; the actions themselves add nothing. If an action fails, you still get the page as it stood, with a warning that names the action and says why.","minItems":1,"maxItems":50,"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"wait"},"milliseconds":{"type":"integer","minimum":1,"maximum":60000}},"required":["type","milliseconds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"wait"},"selector":{"type":"string","minLength":1}},"required":["type","selector"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"click"},"selector":{"type":"string","minLength":1},"all":{"type":"boolean","const":false}},"required":["type","selector"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"write"},"text":{"type":"string","minLength":1}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"press"},"key":{"type":"string","minLength":1,"maxLength":40}},"required":["type","key"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"scroll"},"direction":{"default":"down","type":"string","enum":["up","down","left","right"]},"amount":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"string","enum":["viewport","max"]}]},"maxScrolls":{"type":"integer","minimum":1,"maximum":50},"selector":{"type":"string","minLength":1}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"screenshot"},"fullPage":{"type":"boolean"},"quality":{"type":"integer","minimum":1,"maximum":100},"viewport":{"type":"object","properties":{"width":{"type":"integer","minimum":200,"maximum":3840},"height":{"type":"integer","minimum":200,"maximum":2160}},"required":["width","height"],"additionalProperties":false}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"scrape"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"executeJavascript"},"script":{"type":"string","minLength":1,"maxLength":20000}},"required":["type","script"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"pdf"},"format":{"type":"string","enum":["Letter","Legal","Tabloid","Ledger","A0","A1","A2","A3","A4","A5","A6"]},"landscape":{"type":"boolean"},"scale":{"type":"number","minimum":0.1,"maximum":2}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"perform"},"action":{"type":"string","minLength":1,"maxLength":500}},"required":["type","action"],"additionalProperties":false}]}},"location":{"description":"Where to read the page from. The default is the United States.","type":"object","properties":{"country":{"description":"Two-letter country code to read the page from, such as DE or JP.","type":"string"},"languages":{"description":"Languages to ask the site for, best first, such as [\"de\", \"en\"]. Sent as Accept-Language. A read with languages is never answered from or saved to a stored copy.","minItems":1,"maxItems":5,"type":"array","items":{"type":"string","pattern":"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$"}}},"additionalProperties":false},"removeBase64Images":{"description":"Images inside the page that carry their data in the address (data:image) are dropped by default. Send false to keep them in markdown and html.","type":"boolean"},"blockAds":{"description":"Ads and trackers are not loaded when a page runs in a browser. Send false to load them.","type":"boolean"},"fastMode":{"description":"Send true to read the page without opening a browser: the answer comes sooner, but a page that needs a browser, or that refuses a plain request, comes back as an error instead of being retried. Ignored when the call needs a browser (actions, screenshot, waitFor, mobile, profile, network, branding).","type":"boolean"},"proxy":{"description":"auto: basic first, enhanced once if the site refuses. basic: one plain attempt. enhanced: the stronger read from the start. stealth is the same as enhanced. Same price.","type":"string","enum":["auto","basic","enhanced","stealth"]},"storeInCache":{"default":true,"description":"Send false to skip reading and saving stored copies. Use zeroDataRetention to read live without saving a copy.","type":"boolean"},"lockdown":{"description":"Send true to answer only from a stored copy of the page and never read it live, whatever its age. A page with no stored copy is notFound. The same as minAge 0.","type":"boolean"},"checkPromptInjection":{"description":"Send true to scan the page text for instructions aimed at an AI model before anything is built from it. A page that has them is refused with 403 promptInjectionDetected and costs nothing. The scan adds $2.50 per 1,000 pages when it runs; a page it cannot scan fully comes back with a warning and no charge.","type":"boolean"},"redactPII":{"description":"Send true, or an object, to hide personal data in the markdown and in everything made from it (summary, answers, highlights, json). Links, html and rawHtml are not changed. A page the model cannot scan is refused rather than returned unredacted.","anyOf":[{"type":"boolean"},{"type":"object","properties":{"mode":{"default":"accurate","description":"accurate finds names and places with the model and the rest by pattern. aggressive adds guesses that catch more and may hide a little too much. fast uses patterns only, so it finds no ordinary names or places.","type":"string","enum":["accurate","aggressive","fast"]},"entities":{"default":["PERSON","EMAIL","PHONE","LOCATION","FINANCIAL","SECRET"],"description":"What to hide: PERSON, EMAIL, PHONE, LOCATION, FINANCIAL, SECRET. All by default.","minItems":1,"type":"array","items":{"type":"string","enum":["PERSON","EMAIL","PHONE","LOCATION","FINANCIAL","SECRET"]}},"replaceStyle":{"default":"tag","description":"tag writes <EMAIL>, mask writes * for each character, remove deletes it.","type":"string","enum":["tag","mask","remove"]}},"additionalProperties":false,"description":"Options for redactPII."}]},"profile":{"description":"Read the page with the cookies and local storage that earlier calls saved under this name, kept for your account for 30 days after the last use. A call with a profile always loads the page in a browser, costs $1 per 1,000 pages, the same as any page, and is never answered from a stored copy. Only one call at a time can save to a profile.","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128,"description":"A name you choose, such as shop-login. Calls with the same name share state."},"saveChanges":{"default":true,"description":"Keep the cookies and local storage this read leaves behind for the next call with this name. Send false to read with the profile without changing it.","type":"boolean"}},"required":["name"],"additionalProperties":false},"zeroDataRetention":{"default":false,"description":"Send true to keep nothing from this call: no stored copy is read or made, and nothing from it is logged. Adds $2 per 1,000 scraped URLs, not per PDF page. Not with a screenshot.","type":"boolean"}},"additionalProperties":false},"zeroDataRetention":{"default":false,"description":"Send true to keep nothing from this call: pages are read live, the result is held for one hour at most, and nothing is logged. Adds $2 per 1,000 pages.","type":"boolean"},"ignoreInvalidURLs":{"default":true,"description":"Skip addresses that are not public website URLs. Send false to refuse the call instead.","type":"boolean"}},"additionalProperties":false},"example":{"urls":["https://bun.com/docs/runtime/bunfig"],"schema":{"type":"object","properties":{"file":{"type":"string"}}},"prompt":"What is the name of the configuration file this page describes?"}}}},"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"},"idempotent-replayed":{"$ref":"#/components/headers/IdempotentReplayed"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"success":{"type":"boolean","const":true},"id":{"type":"string"},"invalidURLs":{"type":"array","items":{"type":"string"}}},"required":["success","invalidURLs"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/browser/task":{"post":{"operationId":"browserTask","summary":"Click through a public website in a real browser to search, filter or fill a form","description":"Costs $0.84 per hour of browser time the task runs, billed by the minute, one minute at least, up to maxCost. A task that ends before its first step costs nothing. Starting a task sets aside the most it can cost, and what it does not use comes back when it ends.","x-credits":0,"x-credits-max":70,"x-cost-usd":0,"x-cost-usd-max":0.14,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"description":"The public page to start on, such as https://www.python.org.","type":"string"},"goal":{"type":"string","minLength":1,"maxLength":1000,"description":"What to get done on the page, in one or two sentences."},"values":{"description":"Values the steps will need, such as: from London, to Istanbul, date 2026-12-01. They are typed only on the start page's site.","type":"string","maxLength":1000},"schema":{"description":"Fields to fill when the task is done, as a JSON Schema object. Each one is checked against the pages the task saw and comes back null when no page states it. confidence gives the check's chance for each field.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/browserTask.input.schema0"}},"maxSteps":{"default":50,"description":"The most steps the task may take, 1 to 50.","type":"integer","minimum":1,"maximum":50},"maxCost":{"description":"The most the task may spend, in US dollars. Browser time is $0.84 per hour, so each minute is $0.014, and the task stops when this is spent. Leave out to allow the full 10 minutes.","type":"number","exclusiveMinimum":0}},"required":["url","goal"],"additionalProperties":false}}}},"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"},"idempotent-replayed":{"$ref":"#/components/headers/IdempotentReplayed"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["running","done"]}},"required":["status"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/browser/task/status":{"post":{"operationId":"browserTaskStatus","summary":"Check a browser task and read its result","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The id browser.task returned."},"wait":{"description":"Seconds to wait for the task to end, up to 60. The answer comes as soon as it ends, or when the wait is over with status running.","type":"integer","minimum":0,"maximum":60}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"},"idempotent-replayed":{"$ref":"#/components/headers/IdempotentReplayed"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"status":{"type":"string","enum":["running","done"]},"result":{"type":"object","additionalProperties":false,"properties":{"done":{"type":"boolean"},"answer":{"type":"string"},"reason":{"type":"string"},"steps":{"type":"array","items":{"type":"string"}},"url":{"type":"string"},"title":{"type":"string"},"pageText":{"description":"The page the task ended on, as the browser showed it, so you can check the answer against it.","type":"string"},"seconds":{"type":"number"},"turns":{"description":"How many turns the browser agent took.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/browserTaskStatus.schema0"}},"confidence":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}},"required":["done"]},"creditsUsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"costUsd":{"type":"number","description":"What the task cost, in dollars: 0 while it runs, final once status is done."}},"required":["status","creditsUsed","costUsd"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/browser/task/cancel":{"post":{"operationId":"browserTaskCancel","summary":"Stop a browser task you started","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The id browser.task returned."}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"},"idempotent-replayed":{"$ref":"#/components/headers/IdempotentReplayed"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"status":{"type":"string","enum":["cancelling","done"]}},"required":["status"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/parse":{"post":{"operationId":"parse","summary":"Turn a PDF, Word, Excel, PowerPoint or HTML file, or a picture of text, into markdown","description":"Costs $0.50 per 1,000 pages or files whose text comes from a text layer, and $2.50 per 1,000 pages or pictures read from their picture, up to maxPages; summary and json with a schema or a prompt add $3 per 1,000 each; zero data retention adds $2 per 1,000 calls. metadata.costUsd shows what the call cost in dollars. Works without an API key, within free limits.","security":[{},{"apiKey":[]}],"x-credits":1,"x-credits-max":49,"x-cost-usd":0.0005,"x-cost-usd-max":0.098,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"formats":{"description":"What to send back besides markdown: summary, html and rawHtml (HTML files only), links, images, or { type: json, schema or prompt }. markdown is always sent.","minItems":1,"maxItems":8,"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"json"},"prompt":{"type":"string","minLength":1,"maxLength":2000},"schema":{"description":"The fields to fill, as a JSON Schema (draft-07 or 2020-12) object with properties. Pydantic's model_json_schema() and zod's toJSONSchema() output work as they are. enum, const, anyOf, oneOf, nullable types, $ref with $defs, required, descriptions and any key names are read. Up to 100 top-level fields and 32 KB. A field the page does not state comes back null.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/parse.input.schema0"}}},"required":["type"],"additionalProperties":false},{"anyOf":[{"type":"string","enum":["markdown","summary","html","rawHtml","links","images"]},{"type":"object","properties":{"type":{"type":"string","enum":["markdown","summary","html","rawHtml","links","images"]}},"required":["type"],"additionalProperties":false}]}]}},"parsers":{"description":"How to read PDF pages. Other files ignore it.","maxItems":1,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"pdf"},"mode":{"description":"fast reads the text layer only. auto (the default) reads the text layer and reads the picture of any page that has none. ocr reads the picture of every page.","type":"string","enum":["fast","auto","ocr"]},"maxPages":{"description":"Read at most this many pages, up to 100.","type":"integer","minimum":1,"maximum":100},"pages":{"description":"Send true to also get each page's markdown in pages, as { pageNumber, markdown }. No extra charge.","type":"boolean"},"blocks":{"description":"Send true to also get the page's layout in blocks: each title, section header or run of text, with its page, reading order, position on the page (bbox as left, top, right, bottom from 0 to 1) and where its text sits in that page's markdown (span, as in pages). Tables, figures and formulas are not told apart. A page read from its picture is one block. No extra charge.","type":"boolean"},"pageMarkers":{"description":"Send true to mark page breaks in the markdown: pages are joined with \"---\" and a <!-- page N --> line, where N is the page that follows. No extra charge.","type":"boolean"}},"required":["type"],"additionalProperties":false}},"onlyMainContent":{"description":"For an HTML file: send false to keep navigation and footers. The default is true.","type":"boolean"},"includeTags":{"description":"For an HTML file: keep only what these CSS selectors match.","maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"excludeTags":{"description":"For an HTML file: drop what these CSS selectors match.","maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"removeBase64Images":{"description":"For an HTML file: send false to keep images that carry their data in the address.","type":"boolean"},"zeroDataRetention":{"default":false,"description":"Send true to keep nothing from this call: no stored result is read or made, and nothing is logged. Adds $2 per 1,000 pages.","type":"boolean"},"origin":{"description":"Which client sent the call. Not used.","type":"string","maxLength":200},"integration":{"description":"Which integration sent the call. Not used.","type":"string","maxLength":200},"fastMode":{"description":"Page-read speed. Accepted so a client that always sends it works; a file has no page to apply it to, so it is not used."},"mobile":{"description":"Mobile page view. Accepted so a client that always sends it works; a file has no page to apply it to, so it is not used."},"blockAds":{"description":"Ad blocking. Accepted so a client that always sends it works; a file has no page to apply it to, so it is not used."},"skipTlsVerification":{"description":"TLS checks of a page. Accepted so a client that always sends it works; a file has no page to apply it to, so it is not used."},"timeout":{"description":"Page load time. Accepted so a client that always sends it works; a file has no page to apply it to, so it is not used."},"headers":{"description":"Page request headers. Accepted so a client that always sends it works; a file has no page to apply it to, so it is not used."},"proxy":{"description":"Page proxy. Accepted so a client that always sends it works; a file has no page to apply it to, so it is not used."},"location":{"description":"Page country and languages. Accepted so a client that always sends it works; a file has no page to apply it to, so it is not used."},"profile":{"description":"Saved browser profile. Accepted so a client that always sends it works; a file has no page to apply it to, so it is not used."},"uploadRef":{"description":"Instead of file: the uploadId that POST /v1/parse/upload-url returned, after the file was sent to its uploadUrl. The stored file is deleted when the parse ends.","type":"string","pattern":"^upl_[A-Za-z0-9_-]{16,64}$"},"file":{"description":"The file's bytes as base64, up to 36 MB: a PDF, a Word .docx, an Excel .xlsx, a PowerPoint .pptx, an HTML file or a PNG, JPEG or WebP picture of text.","type":"string","minLength":1},"filename":{"description":"The file's name, such as report.docx. The type is read from the file itself.","type":"string","minLength":1,"maxLength":255},"maxPages":{"default":100,"description":"Read at most this many PDF pages, sheets or slides; isTruncated says when the file had more. Pages of a PDF with no text layer are read from their picture, up to 20 of them, at $2.50 per 1,000 pages.","type":"integer","minimum":1,"maximum":100},"options":{"type":"object","properties":{"formats":{"description":"What to send back besides markdown: summary, html and rawHtml (HTML files only), links, images, or { type: json, schema or prompt }. markdown is always sent.","minItems":1,"maxItems":8,"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"json"},"prompt":{"type":"string","minLength":1,"maxLength":2000},"schema":{"description":"The fields to fill, as a JSON Schema (draft-07 or 2020-12) object with properties. Pydantic's model_json_schema() and zod's toJSONSchema() output work as they are. enum, const, anyOf, oneOf, nullable types, $ref with $defs, required, descriptions and any key names are read. Up to 100 top-level fields and 32 KB. A field the page does not state comes back null.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/parse.input.schema0"}}},"required":["type"],"additionalProperties":false},{"anyOf":[{"type":"string","enum":["markdown","summary","html","rawHtml","links","images"]},{"type":"object","properties":{"type":{"type":"string","enum":["markdown","summary","html","rawHtml","links","images"]}},"required":["type"],"additionalProperties":false}]}]}},"parsers":{"description":"How to read PDF pages. Other files ignore it.","maxItems":1,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"pdf"},"mode":{"description":"fast reads the text layer only. auto (the default) reads the text layer and reads the picture of any page that has none. ocr reads the picture of every page.","type":"string","enum":["fast","auto","ocr"]},"maxPages":{"description":"Read at most this many pages, up to 100.","type":"integer","minimum":1,"maximum":100},"pages":{"description":"Send true to also get each page's markdown in pages, as { pageNumber, markdown }. No extra charge.","type":"boolean"},"blocks":{"description":"Send true to also get the page's layout in blocks: each title, section header or run of text, with its page, reading order, position on the page (bbox as left, top, right, bottom from 0 to 1) and where its text sits in that page's markdown (span, as in pages). Tables, figures and formulas are not told apart. A page read from its picture is one block. No extra charge.","type":"boolean"},"pageMarkers":{"description":"Send true to mark page breaks in the markdown: pages are joined with \"---\" and a <!-- page N --> line, where N is the page that follows. No extra charge.","type":"boolean"}},"required":["type"],"additionalProperties":false}},"onlyMainContent":{"description":"For an HTML file: send false to keep navigation and footers. The default is true.","type":"boolean"},"includeTags":{"description":"For an HTML file: keep only what these CSS selectors match.","maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"excludeTags":{"description":"For an HTML file: drop what these CSS selectors match.","maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"removeBase64Images":{"description":"For an HTML file: send false to keep images that carry their data in the address.","type":"boolean"},"zeroDataRetention":{"type":"boolean"},"origin":{"description":"Which client sent the call. Not used.","type":"string","maxLength":200},"integration":{"description":"Which integration sent the call. Not used.","type":"string","maxLength":200},"fastMode":{"description":"Page-read speed. Accepted so a client that always sends it works; a file has no page to apply it to, so it is not used."},"mobile":{"description":"Mobile page view. Accepted so a client that always sends it works; a file has no page to apply it to, so it is not used."},"blockAds":{"description":"Ad blocking. Accepted so a client that always sends it works; a file has no page to apply it to, so it is not used."},"skipTlsVerification":{"description":"TLS checks of a page. Accepted so a client that always sends it works; a file has no page to apply it to, so it is not used."},"timeout":{"description":"Page load time. Accepted so a client that always sends it works; a file has no page to apply it to, so it is not used."},"headers":{"description":"Page request headers. Accepted so a client that always sends it works; a file has no page to apply it to, so it is not used."},"proxy":{"description":"Page proxy. Accepted so a client that always sends it works; a file has no page to apply it to, so it is not used."},"location":{"description":"Page country and languages. Accepted so a client that always sends it works; a file has no page to apply it to, so it is not used."},"profile":{"description":"Saved browser profile. Accepted so a client that always sends it works; a file has no page to apply it to, so it is not used."}},"additionalProperties":false,"description":"How to read the file and what to send back, with the same names scrape uses for a page."}},"additionalProperties":false},"example":{"file":"PGh0bWw+PGhlYWQ+PHRpdGxlPkhvdyB0aWRlcyB3b3JrPC90aXRsZT48L2hlYWQ+PGJvZHk+PG1haW4+PGgxPkhvdyB0aWRlcyB3b3JrPC9oMT48cD5UaGUgTW9vbiBwdWxscyBvbiB0aGUgb2NlYW5zIGFuZCBtYWtlcyB0d28gYnVsZ2VzIG9mIHdhdGVyIHRoYXQgbW92ZSBhcm91bmQgdGhlIEVhcnRoIGFzIGl0IHR1cm5zLCBzbyBtb3N0IGNvYXN0cyBzZWUgdHdvIGhpZ2ggdGlkZXMgYW5kIHR3byBsb3cgdGlkZXMgZXZlcnkgZGF5LjwvcD48L21haW4+PC9ib2R5PjwvaHRtbD4=","filename":"tides.html"}}}},"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"},"idempotent-replayed":{"$ref":"#/components/headers/IdempotentReplayed"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","additionalProperties":false,"properties":{"markdown":{"type":"string"},"html":{"type":"string"},"rawHtml":{"type":"string"},"links":{"type":"array","items":{"type":"string"}},"images":{"type":"array","items":{"type":"string"}},"summary":{"type":"string"},"json":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/parse.schema0"}},"pages":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/parse.schema0"}}},"blocks":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/parse.schema0"}}},"warning":{"type":"string"},"metadata":{"type":"object","additionalProperties":false,"properties":{"title":{"type":"string"},"contentType":{"type":"string"},"numPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ocrPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"costUsd":{"type":"number"}},"required":["costUsd"]}},"required":["metadata"]}},"required":["success","data"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/map":{"post":{"operationId":"map","summary":"Scrape the list of pages on a website","description":"Costs $0.50 per 1,000 calls. Works without an API key, within free limits.","security":[{},{"apiKey":[]}],"x-credits":1,"x-cost-usd":0.0005,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"description":"Any page of the site to map, such as https://bun.com.","type":"string"},"search":{"description":"Keep only addresses that mention these words, best matches first, such as pricing.","type":"string","minLength":1},"sitemap":{"default":"include","description":"include uses the site's sitemaps and its pages. only lists just what the sitemaps name. skip ignores the sitemaps.","type":"string","enum":["skip","include","only"]},"includeSubdomains":{"default":true,"description":"Also list pages on subdomains, such as docs.bun.com for bun.com.","type":"boolean"},"ignoreQueryParameters":{"default":true,"description":"List each page once, without its ?query part.","type":"boolean"},"deduplicateSimilarURLs":{"description":"Send false to list distinct addresses such as /docs/a, /docs/a/ and /docs/a.md.","type":"boolean"},"ignoreCache":{"default":false,"description":"Send true to build the list again instead of reusing one made in the last 6 hours.","type":"boolean"},"limit":{"default":5000,"description":"The most addresses to return, up to 100000.","type":"integer","minimum":1,"maximum":100000},"timeout":{"description":"Stop looking after this many milliseconds and return what was found.","type":"integer","minimum":1000,"maximum":9007199254740991},"location":{"description":"Where to read the page from. The default is the United States.","type":"object","properties":{"country":{"description":"Two-letter country code to read the page from, such as DE or JP.","type":"string"},"languages":{"description":"Languages to ask the site for, best first, such as [\"de\", \"en\"]. Sent as Accept-Language. A read with languages is never answered from or saved to a stored copy.","minItems":1,"maxItems":5,"type":"array","items":{"type":"string","pattern":"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$"}}},"additionalProperties":false}},"required":["url"],"additionalProperties":false},"example":{"url":"https://bun.com","search":"sqlite"}}}},"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"},"idempotent-replayed":{"$ref":"#/components/headers/IdempotentReplayed"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"success":{"type":"boolean","const":true},"links":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"}},"required":[]}}},"required":["success","links"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/crawl":{"post":{"operationId":"crawl","summary":"Crawl a website in the background","description":"Costs $1 per 1,000 pages, however they are reached. checkPromptInjection adds $2.50 per 1,000 pages when the scan runs, json with a schema or a prompt, summary, highlights, question, product, menu and changeTracking in json mode add $3 per 1,000 pages each when they return something. CSS rules and attributes add nothing. A named parser uses its own price. Any page read or other paid format you ask for is charged separately. A PDF adds $0.50 per 1,000 pages of text from its text layer and $2.50 per 1,000 pages of text read from its picture that come back, so a PDF read with maxChars, offset or query is charged for the share of its pages that it returns, at least 1 page. Browser actions add nothing. An answer from a stored copy within maxAge costs $1 per 1,000 pages like any page. An unreadable page costs nothing. The base page price is waived for a readable 404 or 410. Each page is charged when it finishes. Starting the job is free.","x-credits":0,"x-credits-max":582500,"x-cost-usd":0,"x-cost-usd-max":1165,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"description":"The page to start from, such as https://bun.com/docs.","type":"string"},"prompt":{"description":"What you are looking for, such as sqlite performance. Pages about it are read first, and the crawl stops once new pages stop mentioning it.","type":"string","minLength":1,"maxLength":1000},"includePaths":{"default":[],"description":"Read only pages whose path matches one of these regular expressions, such as blog/.*.","maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"excludePaths":{"default":[],"description":"Skip pages whose path matches one of these regular expressions, such as tag/.*.","maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"maxDiscoveryDepth":{"description":"How many links away from the start page to go. Without it there is no depth limit, and limit bounds the crawl.","type":"integer","minimum":0,"maximum":9007199254740991},"sitemap":{"default":"include","description":"include also uses the site's sitemaps. only reads just the pages the sitemaps name. skip ignores them.","type":"string","enum":["skip","include","only"]},"ignoreQueryParameters":{"default":false,"description":"Treat addresses that differ only in their ?query part as one page.","type":"boolean"},"regexOnFullURL":{"default":false,"description":"Match includePaths and excludePaths against the whole address, not only the path.","type":"boolean"},"limit":{"default":10000,"description":"Stop after reading this many pages in total.","type":"integer","minimum":1,"maximum":10000},"crawlEntireDomain":{"default":false,"description":"Read the whole site, not only pages under the start page's path.","type":"boolean"},"deduplicateSimilarURLs":{"default":true,"description":"Read one page when addresses differ only by www, a trailing slash, a #fragment, tracking parameters such as utm_source, or the order of the ?query. Send false to read each address.","type":"boolean"},"allowExternalLinks":{"default":false,"description":"Also follow links to other sites. They count toward limit and maxDiscoveryDepth. Each other site's robots.txt is read too, for up to 25 new sites per page. A page on a site whose robots.txt cannot be read, or that comes after those 25, is skipped.","type":"boolean"},"allowSubdomains":{"default":false,"description":"Also read pages on subdomains, such as docs.bun.com for bun.com.","type":"boolean"},"delay":{"description":"Seconds to wait between pages. With delay the crawl reads one page at a time. At most 60.","type":"number","minimum":0,"maximum":60},"maxConcurrency":{"description":"Most pages read at once. We read at most 4 at once, so a larger number gives the same speed.","type":"integer","minimum":1,"maximum":100},"scrapeOptions":{"description":"How to read each page, the same options and formats as scrape. Without formats, each page comes back as markdown.","type":"object","properties":{"formats":{"description":"What to return: markdown (clean page text), summary (a short summary of the page), html (the cleaned page), rawHtml (the page as sent), audio and video (for a YouTube link: the audio track as an M4A file, or the video as an MP4 file, as a link that works for 1 hour), rawBase64 (the bytes the site sent, Base64 encoded, from a live read; metadata.contentType says what they are; the address of a picture such as a PNG or JPEG is read only with rawBase64 as the only format), links (every link on the page), images (every image address), screenshot (a link to a JPEG of the visible page, kept for 7 days), changeTracking (what changed in the markdown since your key last read this page with the same options, kept 30 days; add modes [\"git-diff\",\"json\"] with a schema or prompt to compare fields too), question (send { \"type\": \"question\", \"question\": \"...\" } to get answer, left out with a warning when the page does not state one), product (title, brand, category, url, description and variants with price, sale, availability and images, left out with a warning when there is none) and menu (merchant, currency and sections of items with prices, left out with a warning when there is none) network (the JSON the page loaded while it rendered, up to 30 responses) and branding (the page's colors, fonts, typography, spacing, button and input styles, logo and brand images, read from how the page looks, with a field left out when the page does not show it). Send { \"type\": \"screenshot\", \"fullPage\": true } for the whole page. Send { \"type\": \"highlights\", \"query\": \"refund policy\" } for the passages that best match a query. Send { \"type\": \"json\", \"schema\": { \"type\": \"object\", \"properties\": { \"price\": { \"type\": \"number\" } } } } or { \"type\": \"json\", \"prompt\": \"the price and the stock\" } for fields filled from the page, each checked against it. Send { \"type\": \"json\", \"parser\": \"amazon-product\" } to get a site's own data as json instead of reading the page; GET /v1/parsers lists the parsers. Send { \"type\": \"json\", \"rules\": { \"title\": \"h1\", \"links\": { \"selector\": \"a\", \"type\": \"list\", \"output\": \"@href\" } } } to read the page with CSS rules and no model, at the page's own price. Send { \"type\": \"attributes\", \"selectors\": [{ \"selector\": \"a\", \"attribute\": \"href\" }] } for attribute values, returned in attributes. Without a parser or rules, json needs a schema or a prompt and is filled from the page. json with a schema or a prompt, summary, highlights, question, product, menu and changeTracking in json mode add $3 per 1,000 pages each when they return something. JSON with CSS rules and attributes add nothing. A named parser uses its own price. Any page read or other paid format you ask for is charged separately. A screenshot, network or branding read costs $1 per 1,000 pages, the same as any page. A PDF comes back as markdown only, and adds $0.50 per 1,000 pages of text from its text layer and $2.50 per 1,000 pages of text read from its picture that comes back. A CSV or an Excel .xlsx file comes back as markdown tables.","default":["markdown"],"minItems":1,"maxItems":20,"type":"array","items":{"anyOf":[{"type":"string","enum":["markdown","summary","html","rawHtml","rawBase64","links","images","network","branding","audio","video","screenshot","changeTracking","product","menu"]},{"type":"object","properties":{"type":{"type":"string","enum":["markdown","summary","html","rawHtml","rawBase64","links","images","network","branding","audio","video"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"changeTracking"},"modes":{"description":"git-diff returns a unified diff of the markdown. json compares the fields in schema or prompt between this read and the last one. Without modes you get git-diff.","maxItems":2,"type":"array","items":{"type":"string","enum":["git-diff","json"]}},"schema":{"description":"The fields to fill, as a JSON Schema (draft-07 or 2020-12) object with properties. Pydantic's model_json_schema() and zod's toJSONSchema() output work as they are. enum, const, anyOf, oneOf, nullable types, $ref with $defs, required, descriptions and any key names are read. Up to 100 top-level fields and 32 KB. A field the page does not state comes back null.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/crawl.input.schema0"}},"prompt":{"description":"With json mode: what to compare, in plain words, such as the price and stock.","type":"string","minLength":1,"maxLength":10000},"tag":{"type":"null"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"question"},"question":{"type":"string","minLength":1,"maxLength":10000,"description":"A question to answer from the page, such as what the refund window is."}},"required":["type","question"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"product"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"menu"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"screenshot"},"fullPage":{"default":false,"description":"Capture the whole page from top to bottom instead of the visible part.","type":"boolean"},"quality":{"description":"JPEG quality from 1 to 100. The default is 70.","type":"integer","minimum":1,"maximum":100},"viewport":{"description":"The window size in pixels, such as { width: 390, height: 844 }.","type":"object","properties":{"width":{"type":"integer","minimum":200,"maximum":3840},"height":{"type":"integer","minimum":200,"maximum":2160}},"required":["width","height"],"additionalProperties":false}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"highlights"},"query":{"type":"string","minLength":1,"maxLength":10000,"description":"What you are looking for on the page, such as refund policy."},"count":{"default":5,"description":"How many passages to return, best match first.","type":"integer","minimum":1,"maximum":20}},"required":["type","query"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"json"},"parser":{"description":"Read the page with a named parser, which gives the site's own data as json. The url must be the kind of page the parser reads. Parsers are the only way to read some sites. GET /v1/parsers lists them.","type":"string"},"options":{"description":"Only with parser: extra inputs for it, such as { \"page\": 2 } for the next page of results or { \"minRating\": 4.5 } for a filter. GET /v1/parsers lists what each parser accepts.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/crawl.input.schema1"}},"schema":{"description":"The fields to fill, as a JSON Schema (draft-07 or 2020-12) object with properties. Pydantic's model_json_schema() and zod's toJSONSchema() output work as they are. enum, const, anyOf, oneOf, nullable types, $ref with $defs, required, descriptions and any key names are read. Up to 100 top-level fields and 32 KB. A field the page does not state comes back null.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/crawl.input.schema0"}},"prompt":{"description":"What to pull from the page in plain words, such as the version and the release date.","type":"string","minLength":1,"maxLength":10000},"rules":{"description":"Read the page with CSS rules instead of a model, no extra fee. Each field is a selector such as \"h1\" (the first match's text), \"a@href\" (an attribute) or { \"selector\": \"li\", \"type\": \"list\", \"output\": \"text\" | \"html\" | \"@attribute\" | { nested fields } }. A missing item is null and an unmatched list is []. Relative links become absolute. Up to 100 fields, 5 levels deep. Not with schema, prompt or parser.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/crawl.input.schema2"}},"checkPromptInjection":{"description":"Deprecated: send checkPromptInjection at the top level of the call.","type":"boolean"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"attributes"},"selectors":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"selector":{"type":"string","minLength":1},"attribute":{"type":"string","minLength":1,"maxLength":100}},"required":["selector","attribute"],"additionalProperties":false},"description":"The elements and attributes to read, such as { selector: 'a.buy', attribute: 'href' }."}},"required":["type","selectors"],"additionalProperties":false}]}},"onlyMainContent":{"default":true,"description":"Keep only the page's main content, without menus, headers, footers and ads.","type":"boolean"},"onlyCleanContent":{"description":"Send true to have a model remove what onlyMainContent leaves behind in the markdown: cookie banners, ads, share widgets, breadcrumbs, sign-up prompts, comment prompts and related-article lists. It only removes whole paragraphs and lists; it never rewrites or adds text, and code blocks are always kept. Skipped with a warning when the page is too long to clean or the model does not answer. Not with zeroDataRetention. Summary, answers and highlights are made from the cleaned markdown.","type":"boolean"},"includeTags":{"description":"Keep only the parts of the page that match these CSS selectors, such as article or .price. When set, onlyMainContent is not applied.","minItems":1,"type":"array","items":{"type":"string","minLength":1}},"excludeTags":{"description":"Remove the parts of the page that match these CSS selectors, such as .comments.","minItems":1,"type":"array","items":{"type":"string","minLength":1}},"maxAge":{"description":"Accept a stored answer up to this many milliseconds old, at most 30 days. Without it, 2 days, or less for a site whose pages change often, and a copy up to twice that age (at most 7 days) comes back at once as stale while a fresh read runs. 0 always reads the page live. metadata.cacheState says which one you got.","type":"integer","minimum":0,"maximum":9007199254740991},"minAge":{"description":"Answer only from a stored copy that is at least this many milliseconds old, and never read the page live. 0 accepts any stored copy. A page with no such copy is notFound.","type":"integer","minimum":0,"maximum":9007199254740991},"headers":{"description":"Extra request headers to send to the site, such as { \"x-plan\": \"pro\" }. A read with headers is never answered from or saved to a stored copy.","type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9-]{1,64}$"},"additionalProperties":{"type":"string","maxLength":2000,"pattern":"^[\\t\\x20-\\x7e]*$"}},"waitFor":{"description":"Extra milliseconds to wait before reading, up to 60000, for pages that load their content late. To wait for an element, add a wait action with a selector. A read that waits costs $1 per 1,000 pages, the same as any page.","type":"integer","minimum":0,"maximum":60000},"mobile":{"description":"Read the page as a phone would: a phone-sized screen and the mobile version of the site. The page loads in a browser.","type":"boolean"},"skipTlsVerification":{"description":"Send true to read a page whose certificate is expired, self-signed or for another name. The read is not private against someone between us and the site.","type":"boolean"},"timeout":{"description":"How long to keep trying each page, in milliseconds, from 1 second to 5 minutes; 20 seconds, plus waitFor, by default. A page that runs out of time is a failed page and costs nothing.","type":"integer","minimum":1000,"maximum":300000},"parsers":{"description":"Only the pdf parser exists. Send \"pdf\" or { \"type\": \"pdf\", mode, maxPages, pages, blocks, pageMarkers } with the same meaning as in parse. Without mode a PDF is read as auto: from its text layer, and from the picture of any page that has no text. fast reads the text layer only, and ocr reads the picture of every page, up to 20 pages. Each page of text that comes back costs $0.50 per 1,000 pages from its text layer and $2.50 per 1,000 pages from its picture. Pictures are read only with an API key.","minItems":1,"type":"array","items":{"anyOf":[{"type":"string","const":"pdf"},{"type":"object","properties":{"type":{"type":"string","const":"pdf"},"mode":{"description":"fast reads the text layer only. auto (the default) reads the text layer and reads the picture of any page that has none. ocr reads the picture of every page.","type":"string","enum":["fast","auto","ocr"]},"maxPages":{"description":"Read at most this many pages, up to 500, which is also the default.","type":"integer","minimum":1,"maximum":500},"pages":{"description":"Send true to also get each page's markdown in pages, as { pageNumber, markdown }. No extra charge.","type":"boolean"},"blocks":{"description":"Send true to also get the page's layout in blocks: each title, section header or run of text, with its page, reading order, position on the page (bbox as left, top, right, bottom from 0 to 1) and where its text sits in that page's markdown (span, as in pages). Tables, figures and formulas are not told apart. A page read from its picture is one block. No extra charge.","type":"boolean"},"pageMarkers":{"description":"Send true to mark page breaks in the markdown: pages are joined with \"---\" and a <!-- page N --> line, where N is the page that follows. No extra charge.","type":"boolean"}},"required":["type"],"additionalProperties":false}]}},"actions":{"description":"Up to 50 steps to run on the page, in order, before reading it: { \"type\": \"wait\", \"milliseconds\": 500 } (up to 60 seconds), { \"type\": \"wait\", \"selector\": \".results\" }, { \"type\": \"click\", \"selector\": \"button.more\" }, { \"type\": \"write\", \"text\": \"tides\" }, { \"type\": \"press\", \"key\": \"Enter\" }, { \"type\": \"scroll\", \"direction\": \"down\" } (also up, left or right; amount is pixels, \"viewport\" or \"max\"; maxScrolls 1 to 50; selector scrolls an inner container; \"max\" keeps scrolling until the page stops growing, for feeds that load as you go), { \"type\": \"screenshot\", \"fullPage\": true } (links come back in actions.screenshots), { \"type\": \"scrape\" } (the page at that point, in actions.scrapes), { \"type\": \"executeJavascript\", \"script\": \"document.title\" } (results in actions.javascriptReturns), { \"type\": \"pdf\", \"format\": \"A4\" } (links in actions.pdfs) or { \"type\": \"perform\", \"action\": \"Click the Load more button\" } (a step in plain words, up to 5 browser steps on this page, never leaving the site; at most 5 per call). A read with actions costs $1 per 1,000 pages, the same as any page; the actions themselves add nothing. If an action fails, you still get the page as it stood, with a warning that names the action and says why.","minItems":1,"maxItems":50,"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"wait"},"milliseconds":{"type":"integer","minimum":1,"maximum":60000}},"required":["type","milliseconds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"wait"},"selector":{"type":"string","minLength":1}},"required":["type","selector"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"click"},"selector":{"type":"string","minLength":1},"all":{"type":"boolean","const":false}},"required":["type","selector"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"write"},"text":{"type":"string","minLength":1}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"press"},"key":{"type":"string","minLength":1,"maxLength":40}},"required":["type","key"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"scroll"},"direction":{"default":"down","type":"string","enum":["up","down","left","right"]},"amount":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"string","enum":["viewport","max"]}]},"maxScrolls":{"type":"integer","minimum":1,"maximum":50},"selector":{"type":"string","minLength":1}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"screenshot"},"fullPage":{"type":"boolean"},"quality":{"type":"integer","minimum":1,"maximum":100},"viewport":{"type":"object","properties":{"width":{"type":"integer","minimum":200,"maximum":3840},"height":{"type":"integer","minimum":200,"maximum":2160}},"required":["width","height"],"additionalProperties":false}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"scrape"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"executeJavascript"},"script":{"type":"string","minLength":1,"maxLength":20000}},"required":["type","script"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"pdf"},"format":{"type":"string","enum":["Letter","Legal","Tabloid","Ledger","A0","A1","A2","A3","A4","A5","A6"]},"landscape":{"type":"boolean"},"scale":{"type":"number","minimum":0.1,"maximum":2}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"perform"},"action":{"type":"string","minLength":1,"maxLength":500}},"required":["type","action"],"additionalProperties":false}]}},"location":{"description":"Where to read the page from. The default is the United States.","type":"object","properties":{"country":{"description":"Two-letter country code to read the page from, such as DE or JP.","type":"string"},"languages":{"description":"Languages to ask the site for, best first, such as [\"de\", \"en\"]. Sent as Accept-Language. A read with languages is never answered from or saved to a stored copy.","minItems":1,"maxItems":5,"type":"array","items":{"type":"string","pattern":"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$"}}},"additionalProperties":false},"removeBase64Images":{"description":"Images inside the page that carry their data in the address (data:image) are dropped by default. Send false to keep them in markdown and html.","type":"boolean"},"blockAds":{"description":"Ads and trackers are not loaded when a page runs in a browser. Send false to load them.","type":"boolean"},"fastMode":{"description":"Send true to read the page without opening a browser: the answer comes sooner, but a page that needs a browser, or that refuses a plain request, comes back as an error instead of being retried. Ignored when the call needs a browser (actions, screenshot, waitFor, mobile, profile, network, branding).","type":"boolean"},"proxy":{"description":"auto: basic first, enhanced once if the site refuses. basic: one plain attempt. enhanced: the stronger read from the start. stealth is the same as enhanced. Same price.","type":"string","enum":["auto","basic","enhanced","stealth"]},"storeInCache":{"default":true,"description":"Send false to neither read nor keep a stored copy of this page.","type":"boolean"},"lockdown":{"description":"Send true to answer only from a stored copy of the page and never read it live, whatever its age. A page with no stored copy is notFound. The same as minAge 0.","type":"boolean"},"checkPromptInjection":{"description":"Send true to scan the page text for instructions aimed at an AI model before anything is built from it. A page that has them is refused with 403 promptInjectionDetected and costs nothing. The scan adds $2.50 per 1,000 pages when it runs; a page it cannot scan fully comes back with a warning and no charge.","type":"boolean"},"redactPII":{"description":"Send true, or an object, to hide personal data in the markdown and in everything made from it (summary, answers, highlights, json). Links, html and rawHtml are not changed. A page the model cannot scan is refused rather than returned unredacted.","anyOf":[{"type":"boolean"},{"type":"object","properties":{"mode":{"default":"accurate","description":"accurate finds names and places with the model and the rest by pattern. aggressive adds guesses that catch more and may hide a little too much. fast uses patterns only, so it finds no ordinary names or places.","type":"string","enum":["accurate","aggressive","fast"]},"entities":{"default":["PERSON","EMAIL","PHONE","LOCATION","FINANCIAL","SECRET"],"description":"What to hide: PERSON, EMAIL, PHONE, LOCATION, FINANCIAL, SECRET. All by default.","minItems":1,"type":"array","items":{"type":"string","enum":["PERSON","EMAIL","PHONE","LOCATION","FINANCIAL","SECRET"]}},"replaceStyle":{"default":"tag","description":"tag writes <EMAIL>, mask writes * for each character, remove deletes it.","type":"string","enum":["tag","mask","remove"]}},"additionalProperties":false,"description":"Options for redactPII."}]},"profile":{"description":"Read the page with the cookies and local storage that earlier calls saved under this name, kept for your account for 30 days after the last use. A call with a profile always loads the page in a browser, costs $1 per 1,000 pages, the same as any page, and is never answered from a stored copy. Only one call at a time can save to a profile.","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128,"description":"A name you choose, such as shop-login. Calls with the same name share state."},"saveChanges":{"default":true,"description":"Keep the cookies and local storage this read leaves behind for the next call with this name. Send false to read with the profile without changing it.","type":"boolean"}},"required":["name"],"additionalProperties":false},"zeroDataRetention":{"default":false,"description":"Send true to keep nothing from this call: no stored copy is read or made, and nothing from it is logged. Adds $2 per 1,000 scraped URLs, not per PDF page. Not with a screenshot.","type":"boolean"}}},"zeroDataRetention":{"default":false,"description":"Send true to keep nothing from this crawl: no stored copy is read or made, page results are held for one hour at most, and nothing is logged. Adds $2 per 1,000 pages.","type":"boolean"},"webhook":{"description":"Where to be told about the job: a plain address, or { url } which gets a JSON POST when the job starts, for each finished page, and when the job ends. headers are sent with every call, metadata comes back in every call, and events picks which of started, page, action, completed, failed and cancelled to send (all by default). An agent run sends action for each step it takes, and page too. Every call is signed: read Stophy-Signature (t=<unix seconds>,v1=<hex>), where v1 is the HMAC-SHA256 of \"<t>.<body>\" with your webhook secret from webhook.secret. A call that gets no 2xx is sent again, up to 3 times. Every call has an eventId that stays the same when the call is sent again, so you can skip one you already handled. If your address answers slowly, a page event can carry only the page url. Read that page with the status call.","anyOf":[{"type":"string"},{"type":"object","properties":{"url":{"type":"string"},"headers":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9-]{1,64}$"},"additionalProperties":{"type":"string","maxLength":1000}},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/crawl.input.schema0"}},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["started","page","action","completed","failed","cancelled"]}}},"required":["url"],"additionalProperties":false}]}},"required":["url"],"additionalProperties":false},"example":{"url":"https://bun.com/docs","limit":2}}}},"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"},"idempotent-replayed":{"$ref":"#/components/headers/IdempotentReplayed"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"success":{"type":"boolean","const":true},"id":{"type":"string"},"url":{"type":"string"},"status":{"type":"string","const":"scraping"},"queuePosition":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["success"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"crawlList","summary":"List your background crawls, newest first","description":"Costs $0 per 1,000 calls. Pages with cursor.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"status","in":"query","required":false,"schema":{"description":"Only jobs in this status.","type":"string","enum":["scraping","completed","cancelled","failed"]}},{"name":"limit","in":"query","required":false,"schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"description":"The cursor from the previous response. Send it as is."}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"crawls":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["scraping","completed","cancelled","failed"]},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"completed":{"type":"integer","minimum":0,"maximum":9007199254740991},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991},"creditsUsed":{"type":"integer","minimum":0,"maximum":9007199254740991},"costUsd":{"type":"number"},"createdAt":{"type":"string"},"completedAt":{"type":"string"},"expiresAt":{"type":"string"},"message":{"type":"string"}},"required":["status","total","completed","failed","creditsUsed","costUsd"]}},"cursor":{"type":"string"}},"required":["crawls"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/crawl/{id}":{"get":{"operationId":"crawlStatus","summary":"Check a background crawl and read the finished pages","description":"Costs $0 per 1,000 calls. Pages with cursor.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"checkpoint","in":"query","required":false,"schema":{"description":"Send ck_start to start reading with checkpoints. Send the returned checkpoint here to resume, even when no more pages are ready.","type":"string","pattern":"^(?:ck_(?:start|[A-Za-z0-9_-]{20,32}))$"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"description":"The cursor from the previous response. Send it as is."}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"success":{"type":"boolean","const":true},"status":{"type":"string","enum":["scraping","completed","failed","cancelled"]},"queuePosition":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"timestamp":{"type":"string"},"url":{"type":"string"},"error":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"at":{"type":"string"}},"required":["retryable"]}},"creditsUsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"costUsd":{"type":"number"},"createdAt":{"type":"string"},"completedAt":{"type":"string"},"duration":{"type":"number"},"expiresAt":{"type":"string"},"next":{"type":"string"},"checkpoint":{"type":"string"},"message":{"type":"string"},"data":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"markdown":{"type":"string"},"summary":{"type":"string"},"html":{"type":"string"},"rawHtml":{"type":"string"},"links":{"type":"array","items":{"type":"string"}},"images":{"type":"array","items":{"type":"string"}},"attributes":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"selector":{"type":"string"},"attribute":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":[]}},"screenshot":{"type":"string"},"json":{"$ref":"#/components/schemas/crawlStatus.schema0"},"highlights":{"type":"string"},"isTruncated":{"type":"boolean"},"nextOffset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"changeTracking":{"type":"object","additionalProperties":false,"properties":{"previousScrapeAt":{"type":"string"},"changeStatus":{"type":"string","enum":["new","same","changed"]},"visibility":{"type":"string"},"diff":{"type":"string"}},"required":[]},"branding":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/crawlStatus.schema0"}},"actions":{"type":"object","additionalProperties":false,"properties":{"screenshots":{"type":"array","items":{"type":"string"}},"scrapes":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string"},"html":{"type":"string"}},"required":[]}},"javascriptReturns":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string"},"value":{"$ref":"#/components/schemas/crawlStatus.schema0"}},"required":[]}},"pdfs":{"type":"array","items":{"type":"string"}}},"required":[]},"warning":{"type":"string"},"metadata":{"type":"object","additionalProperties":{},"description":"Facts about the page. Named page facts such as ogTitle or keywords appear when the page has them, and every meta tag also appears under its own name, such as og:title.","properties":{"title":{"type":"string"},"description":{"type":"string"},"language":{"type":"string"},"ogImage":{"type":"string"},"sourceURL":{"type":"string"},"url":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contentType":{"type":"string"},"numPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cacheState":{"type":"string","enum":["hit","miss","stale"]},"cachedAt":{"type":"string"},"scrapeId":{"type":"string"},"creditsUsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"costUsd":{"type":"number"}},"required":["statusCode"]}},"required":["isTruncated","metadata"]}}},"required":["success","status","total","completed","failed","errors","creditsUsed","costUsd","data"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"crawlCancel","summary":"Stop a background crawl and keep the pages already read","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"status":{"type":"string","const":"cancelled"},"success":{"type":"boolean","const":true}},"required":["status","success"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/crawl/{id}/errors":{"get":{"operationId":"crawlErrors","summary":"List the pages a background crawl could not read, and why","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"success":{"type":"boolean","const":true},"status":{"type":"string","enum":["scraping","completed","failed","cancelled"]},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"timestamp":{"type":"string"},"url":{"type":"string"},"error":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"at":{"type":"string"}},"required":["retryable"]}},"robotsBlocked":{"type":"array","items":{"type":"string"}},"isTruncated":{"type":"boolean"}},"required":["success","status","failed","errors","robotsBlocked"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/crawl/params-preview":{"post":{"operationId":"crawlParams-preview","summary":"Turn a plain-language crawl request into the options crawl takes, without starting one","description":"Costs $3 per 1,000 calls.","x-credits":2,"x-cost-usd":0.003,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"description":"The site to crawl, such as https://bun.com.","type":"string"},"prompt":{"type":"string","minLength":1,"maxLength":1000,"description":"What you want from the crawl, such as only the blog posts."}},"required":["url","prompt"],"additionalProperties":false}}}},"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"},"idempotent-replayed":{"$ref":"#/components/headers/IdempotentReplayed"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string"},"includePaths":{"type":"array","items":{"type":"string"}},"excludePaths":{"type":"array","items":{"type":"string"}},"maxDiscoveryDepth":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"crawlEntireDomain":{"type":"boolean"},"allowSubdomains":{"type":"boolean"},"allowExternalLinks":{"type":"boolean"},"sitemap":{"type":"string","enum":["skip","include","only"]},"ignoreQueryParameters":{"type":"boolean"},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":[]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/batch/scrape":{"post":{"operationId":"batchScrape","summary":"Scrape many pages in the background","description":"Costs $1 per 1,000 pages, however they are reached. checkPromptInjection adds $2.50 per 1,000 pages when the scan runs, json with a schema or a prompt, summary, highlights, question, product, menu and changeTracking in json mode add $3 per 1,000 pages each when they return something. CSS rules and attributes add nothing. A named parser uses its own price. Any page read or other paid format you ask for is charged separately. A PDF adds $0.50 per 1,000 pages of text from its text layer and $2.50 per 1,000 pages of text read from its picture that come back, so a PDF read with maxChars, offset or query is charged for the share of its pages that it returns, at least 1 page. Browser actions add nothing. An answer from a stored copy within maxAge costs $1 per 1,000 pages like any page. An unreadable page costs nothing. The base page price is waived for a readable 404 or 410. Each page is charged when it finishes. The catalog estimate is per page, not for the whole batch. Starting the job is free.","x-credits":0,"x-credits-max":59,"x-cost-usd":0,"x-cost-usd-max":0.1165,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"urls":{"minItems":1,"type":"array","items":{"type":"string","maxLength":2048},"description":"The pages or PDFs to read. An address sent twice is read once."},"webhook":{"description":"Where to be told about the job: a plain address, or { url } which gets a JSON POST when the job starts, for each finished page, and when the job ends. headers are sent with every call, metadata comes back in every call, and events picks which of started, page, action, completed, failed and cancelled to send (all by default). An agent run sends action for each step it takes, and page too. Every call is signed: read Stophy-Signature (t=<unix seconds>,v1=<hex>), where v1 is the HMAC-SHA256 of \"<t>.<body>\" with your webhook secret from webhook.secret. A call that gets no 2xx is sent again, up to 3 times. Every call has an eventId that stays the same when the call is sent again, so you can skip one you already handled. If your address answers slowly, a page event can carry only the page url. Read that page with the status call.","anyOf":[{"type":"string"},{"type":"object","properties":{"url":{"type":"string"},"headers":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9-]{1,64}$"},"additionalProperties":{"type":"string","maxLength":1000}},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/batchScrape.input.schema0"}},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["started","page","action","completed","failed","cancelled"]}}},"required":["url"],"additionalProperties":false}]},"maxConcurrency":{"description":"Most pages read at once for this batch. We read at most 4 at once, so a larger number gives the same speed.","type":"integer","minimum":1,"maximum":100},"appendToId":{"description":"The id of a batch of yours that is still running: add urls to it instead of starting a new batch. The batch keeps its own options and webhook. Answers jobFinished when the batch is over.","type":"string","pattern":"^[A-Za-z0-9_-]{1,100}$"},"ignoreInvalidURLs":{"default":true,"description":"Skip addresses that are not public website URLs and list them in invalidURLs. Send false to refuse the whole batch instead.","type":"boolean"},"formats":{"description":"What to return: markdown (clean page text), summary (a short summary of the page), html (the cleaned page), rawHtml (the page as sent), audio and video (for a YouTube link: the audio track as an M4A file, or the video as an MP4 file, as a link that works for 1 hour), rawBase64 (the bytes the site sent, Base64 encoded, from a live read; metadata.contentType says what they are; the address of a picture such as a PNG or JPEG is read only with rawBase64 as the only format), links (every link on the page), images (every image address), screenshot (a link to a JPEG of the visible page, kept for 7 days), changeTracking (what changed in the markdown since your key last read this page with the same options, kept 30 days; add modes [\"git-diff\",\"json\"] with a schema or prompt to compare fields too), question (send { \"type\": \"question\", \"question\": \"...\" } to get answer, left out with a warning when the page does not state one), product (title, brand, category, url, description and variants with price, sale, availability and images, left out with a warning when there is none) and menu (merchant, currency and sections of items with prices, left out with a warning when there is none) network (the JSON the page loaded while it rendered, up to 30 responses) and branding (the page's colors, fonts, typography, spacing, button and input styles, logo and brand images, read from how the page looks, with a field left out when the page does not show it). Send { \"type\": \"screenshot\", \"fullPage\": true } for the whole page. Send { \"type\": \"highlights\", \"query\": \"refund policy\" } for the passages that best match a query. Send { \"type\": \"json\", \"schema\": { \"type\": \"object\", \"properties\": { \"price\": { \"type\": \"number\" } } } } or { \"type\": \"json\", \"prompt\": \"the price and the stock\" } for fields filled from the page, each checked against it. Send { \"type\": \"json\", \"parser\": \"amazon-product\" } to get a site's own data as json instead of reading the page; GET /v1/parsers lists the parsers. Send { \"type\": \"json\", \"rules\": { \"title\": \"h1\", \"links\": { \"selector\": \"a\", \"type\": \"list\", \"output\": \"@href\" } } } to read the page with CSS rules and no model, at the page's own price. Send { \"type\": \"attributes\", \"selectors\": [{ \"selector\": \"a\", \"attribute\": \"href\" }] } for attribute values, returned in attributes. Without a parser or rules, json needs a schema or a prompt and is filled from the page. json with a schema or a prompt, summary, highlights, question, product, menu and changeTracking in json mode add $3 per 1,000 pages each when they return something. JSON with CSS rules and attributes add nothing. A named parser uses its own price. Any page read or other paid format you ask for is charged separately. A screenshot, network or branding read costs $1 per 1,000 pages, the same as any page. A PDF comes back as markdown only, and adds $0.50 per 1,000 pages of text from its text layer and $2.50 per 1,000 pages of text read from its picture that comes back. A CSV or an Excel .xlsx file comes back as markdown tables.","default":["markdown"],"minItems":1,"maxItems":20,"type":"array","items":{"anyOf":[{"type":"string","enum":["markdown","summary","html","rawHtml","rawBase64","links","images","network","branding","audio","video","screenshot","changeTracking","product","menu"]},{"type":"object","properties":{"type":{"type":"string","enum":["markdown","summary","html","rawHtml","rawBase64","links","images","network","branding","audio","video"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"changeTracking"},"modes":{"description":"git-diff returns a unified diff of the markdown. json compares the fields in schema or prompt between this read and the last one. Without modes you get git-diff.","maxItems":2,"type":"array","items":{"type":"string","enum":["git-diff","json"]}},"schema":{"description":"The fields to fill, as a JSON Schema (draft-07 or 2020-12) object with properties. Pydantic's model_json_schema() and zod's toJSONSchema() output work as they are. enum, const, anyOf, oneOf, nullable types, $ref with $defs, required, descriptions and any key names are read. Up to 100 top-level fields and 32 KB. A field the page does not state comes back null.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/batchScrape.input.schema0"}},"prompt":{"description":"With json mode: what to compare, in plain words, such as the price and stock.","type":"string","minLength":1,"maxLength":10000},"tag":{"type":"null"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"question"},"question":{"type":"string","minLength":1,"maxLength":10000,"description":"A question to answer from the page, such as what the refund window is."}},"required":["type","question"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"product"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"menu"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"screenshot"},"fullPage":{"default":false,"description":"Capture the whole page from top to bottom instead of the visible part.","type":"boolean"},"quality":{"description":"JPEG quality from 1 to 100. The default is 70.","type":"integer","minimum":1,"maximum":100},"viewport":{"description":"The window size in pixels, such as { width: 390, height: 844 }.","type":"object","properties":{"width":{"type":"integer","minimum":200,"maximum":3840},"height":{"type":"integer","minimum":200,"maximum":2160}},"required":["width","height"],"additionalProperties":false}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"highlights"},"query":{"type":"string","minLength":1,"maxLength":10000,"description":"What you are looking for on the page, such as refund policy."},"count":{"default":5,"description":"How many passages to return, best match first.","type":"integer","minimum":1,"maximum":20}},"required":["type","query"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"json"},"parser":{"description":"Read the page with a named parser, which gives the site's own data as json. The url must be the kind of page the parser reads. Parsers are the only way to read some sites. GET /v1/parsers lists them.","type":"string"},"options":{"description":"Only with parser: extra inputs for it, such as { \"page\": 2 } for the next page of results or { \"minRating\": 4.5 } for a filter. GET /v1/parsers lists what each parser accepts.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/batchScrape.input.schema1"}},"schema":{"description":"The fields to fill, as a JSON Schema (draft-07 or 2020-12) object with properties. Pydantic's model_json_schema() and zod's toJSONSchema() output work as they are. enum, const, anyOf, oneOf, nullable types, $ref with $defs, required, descriptions and any key names are read. Up to 100 top-level fields and 32 KB. A field the page does not state comes back null.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/batchScrape.input.schema0"}},"prompt":{"description":"What to pull from the page in plain words, such as the version and the release date.","type":"string","minLength":1,"maxLength":10000},"rules":{"description":"Read the page with CSS rules instead of a model, no extra fee. Each field is a selector such as \"h1\" (the first match's text), \"a@href\" (an attribute) or { \"selector\": \"li\", \"type\": \"list\", \"output\": \"text\" | \"html\" | \"@attribute\" | { nested fields } }. A missing item is null and an unmatched list is []. Relative links become absolute. Up to 100 fields, 5 levels deep. Not with schema, prompt or parser.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/batchScrape.input.schema2"}},"checkPromptInjection":{"description":"Deprecated: send checkPromptInjection at the top level of the call.","type":"boolean"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"attributes"},"selectors":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"selector":{"type":"string","minLength":1},"attribute":{"type":"string","minLength":1,"maxLength":100}},"required":["selector","attribute"],"additionalProperties":false},"description":"The elements and attributes to read, such as { selector: 'a.buy', attribute: 'href' }."}},"required":["type","selectors"],"additionalProperties":false}]}},"onlyMainContent":{"default":true,"description":"Keep only the page's main content, without menus, headers, footers and ads.","type":"boolean"},"onlyCleanContent":{"description":"Send true to have a model remove what onlyMainContent leaves behind in the markdown: cookie banners, ads, share widgets, breadcrumbs, sign-up prompts, comment prompts and related-article lists. It only removes whole paragraphs and lists; it never rewrites or adds text, and code blocks are always kept. Skipped with a warning when the page is too long to clean or the model does not answer. Not with zeroDataRetention. Summary, answers and highlights are made from the cleaned markdown.","type":"boolean"},"includeTags":{"description":"Keep only the parts of the page that match these CSS selectors, such as article or .price. When set, onlyMainContent is not applied.","minItems":1,"type":"array","items":{"type":"string","minLength":1}},"excludeTags":{"description":"Remove the parts of the page that match these CSS selectors, such as .comments.","minItems":1,"type":"array","items":{"type":"string","minLength":1}},"maxAge":{"description":"Accept a stored answer up to this many milliseconds old, at most 30 days. Without it, 2 days, or less for a site whose pages change often, and a copy up to twice that age (at most 7 days) comes back at once as stale while a fresh read runs. 0 always reads the page live. metadata.cacheState says which one you got.","type":"integer","minimum":0,"maximum":9007199254740991},"minAge":{"description":"Answer only from a stored copy that is at least this many milliseconds old, and never read the page live. 0 accepts any stored copy. A page with no such copy is notFound.","type":"integer","minimum":0,"maximum":9007199254740991},"headers":{"description":"Extra request headers to send to the site, such as { \"x-plan\": \"pro\" }. A read with headers is never answered from or saved to a stored copy.","type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9-]{1,64}$"},"additionalProperties":{"type":"string","maxLength":2000,"pattern":"^[\\t\\x20-\\x7e]*$"}},"waitFor":{"description":"Extra milliseconds to wait before reading, up to 60000, for pages that load their content late. To wait for an element, add a wait action with a selector. A read that waits costs $1 per 1,000 pages, the same as any page.","type":"integer","minimum":0,"maximum":60000},"mobile":{"description":"Read the page as a phone would: a phone-sized screen and the mobile version of the site. The page loads in a browser.","type":"boolean"},"skipTlsVerification":{"description":"Send true to read a page whose certificate is expired, self-signed or for another name. The read is not private against someone between us and the site.","type":"boolean"},"timeout":{"default":60000,"description":"How long to keep trying, in milliseconds, from 1 second to 5 minutes; 60 seconds by default. A page that needs a browser needs at least 5 seconds, and pages behind a bot check can need 10 to 30 seconds the first time. A read that runs out of time is an error and costs nothing.","type":"integer","minimum":1000,"maximum":300000},"parsers":{"description":"Only the pdf parser exists. Send \"pdf\" or { \"type\": \"pdf\", mode, maxPages, pages, blocks, pageMarkers } with the same meaning as in parse. Without mode a PDF is read as auto: from its text layer, and from the picture of any page that has no text. fast reads the text layer only, and ocr reads the picture of every page, up to 20 pages. Each page of text that comes back costs $0.50 per 1,000 pages from its text layer and $2.50 per 1,000 pages from its picture. Pictures are read only with an API key.","minItems":1,"type":"array","items":{"anyOf":[{"type":"string","const":"pdf"},{"type":"object","properties":{"type":{"type":"string","const":"pdf"},"mode":{"description":"fast reads the text layer only. auto (the default) reads the text layer and reads the picture of any page that has none. ocr reads the picture of every page.","type":"string","enum":["fast","auto","ocr"]},"maxPages":{"description":"Read at most this many pages, up to 500, which is also the default.","type":"integer","minimum":1,"maximum":500},"pages":{"description":"Send true to also get each page's markdown in pages, as { pageNumber, markdown }. No extra charge.","type":"boolean"},"blocks":{"description":"Send true to also get the page's layout in blocks: each title, section header or run of text, with its page, reading order, position on the page (bbox as left, top, right, bottom from 0 to 1) and where its text sits in that page's markdown (span, as in pages). Tables, figures and formulas are not told apart. A page read from its picture is one block. No extra charge.","type":"boolean"},"pageMarkers":{"description":"Send true to mark page breaks in the markdown: pages are joined with \"---\" and a <!-- page N --> line, where N is the page that follows. No extra charge.","type":"boolean"}},"required":["type"],"additionalProperties":false}]}},"actions":{"description":"Up to 50 steps to run on the page, in order, before reading it: { \"type\": \"wait\", \"milliseconds\": 500 } (up to 60 seconds), { \"type\": \"wait\", \"selector\": \".results\" }, { \"type\": \"click\", \"selector\": \"button.more\" }, { \"type\": \"write\", \"text\": \"tides\" }, { \"type\": \"press\", \"key\": \"Enter\" }, { \"type\": \"scroll\", \"direction\": \"down\" } (also up, left or right; amount is pixels, \"viewport\" or \"max\"; maxScrolls 1 to 50; selector scrolls an inner container; \"max\" keeps scrolling until the page stops growing, for feeds that load as you go), { \"type\": \"screenshot\", \"fullPage\": true } (links come back in actions.screenshots), { \"type\": \"scrape\" } (the page at that point, in actions.scrapes), { \"type\": \"executeJavascript\", \"script\": \"document.title\" } (results in actions.javascriptReturns), { \"type\": \"pdf\", \"format\": \"A4\" } (links in actions.pdfs) or { \"type\": \"perform\", \"action\": \"Click the Load more button\" } (a step in plain words, up to 5 browser steps on this page, never leaving the site; at most 5 per call). A read with actions costs $1 per 1,000 pages, the same as any page; the actions themselves add nothing. If an action fails, you still get the page as it stood, with a warning that names the action and says why.","minItems":1,"maxItems":50,"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"wait"},"milliseconds":{"type":"integer","minimum":1,"maximum":60000}},"required":["type","milliseconds"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"wait"},"selector":{"type":"string","minLength":1}},"required":["type","selector"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"click"},"selector":{"type":"string","minLength":1},"all":{"type":"boolean","const":false}},"required":["type","selector"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"write"},"text":{"type":"string","minLength":1}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"press"},"key":{"type":"string","minLength":1,"maxLength":40}},"required":["type","key"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"scroll"},"direction":{"default":"down","type":"string","enum":["up","down","left","right"]},"amount":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"string","enum":["viewport","max"]}]},"maxScrolls":{"type":"integer","minimum":1,"maximum":50},"selector":{"type":"string","minLength":1}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"screenshot"},"fullPage":{"type":"boolean"},"quality":{"type":"integer","minimum":1,"maximum":100},"viewport":{"type":"object","properties":{"width":{"type":"integer","minimum":200,"maximum":3840},"height":{"type":"integer","minimum":200,"maximum":2160}},"required":["width","height"],"additionalProperties":false}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"scrape"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"executeJavascript"},"script":{"type":"string","minLength":1,"maxLength":20000}},"required":["type","script"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"pdf"},"format":{"type":"string","enum":["Letter","Legal","Tabloid","Ledger","A0","A1","A2","A3","A4","A5","A6"]},"landscape":{"type":"boolean"},"scale":{"type":"number","minimum":0.1,"maximum":2}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"perform"},"action":{"type":"string","minLength":1,"maxLength":500}},"required":["type","action"],"additionalProperties":false}]}},"location":{"description":"Where to read the page from. The default is the United States.","type":"object","properties":{"country":{"description":"Two-letter country code to read the page from, such as DE or JP.","type":"string"},"languages":{"description":"Languages to ask the site for, best first, such as [\"de\", \"en\"]. Sent as Accept-Language. A read with languages is never answered from or saved to a stored copy.","minItems":1,"maxItems":5,"type":"array","items":{"type":"string","pattern":"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$"}}},"additionalProperties":false},"removeBase64Images":{"description":"Images inside the page that carry their data in the address (data:image) are dropped by default. Send false to keep them in markdown and html.","type":"boolean"},"blockAds":{"description":"Ads and trackers are not loaded when a page runs in a browser. Send false to load them.","type":"boolean"},"fastMode":{"description":"Send true to read the page without opening a browser: the answer comes sooner, but a page that needs a browser, or that refuses a plain request, comes back as an error instead of being retried. Ignored when the call needs a browser (actions, screenshot, waitFor, mobile, profile, network, branding).","type":"boolean"},"proxy":{"description":"auto: basic first, enhanced once if the site refuses. basic: one plain attempt. enhanced: the stronger read from the start. stealth is the same as enhanced. Same price.","type":"string","enum":["auto","basic","enhanced","stealth"]},"storeInCache":{"default":true,"description":"Send false to neither read nor keep a stored copy of this page.","type":"boolean"},"lockdown":{"description":"Send true to answer only from a stored copy of the page and never read it live, whatever its age. A page with no stored copy is notFound. The same as minAge 0.","type":"boolean"},"checkPromptInjection":{"description":"Send true to scan the page text for instructions aimed at an AI model before anything is built from it. A page that has them is refused with 403 promptInjectionDetected and costs nothing. The scan adds $2.50 per 1,000 pages when it runs; a page it cannot scan fully comes back with a warning and no charge.","type":"boolean"},"redactPII":{"description":"Send true, or an object, to hide personal data in the markdown and in everything made from it (summary, answers, highlights, json). Links, html and rawHtml are not changed. A page the model cannot scan is refused rather than returned unredacted.","anyOf":[{"type":"boolean"},{"type":"object","properties":{"mode":{"default":"accurate","description":"accurate finds names and places with the model and the rest by pattern. aggressive adds guesses that catch more and may hide a little too much. fast uses patterns only, so it finds no ordinary names or places.","type":"string","enum":["accurate","aggressive","fast"]},"entities":{"default":["PERSON","EMAIL","PHONE","LOCATION","FINANCIAL","SECRET"],"description":"What to hide: PERSON, EMAIL, PHONE, LOCATION, FINANCIAL, SECRET. All by default.","minItems":1,"type":"array","items":{"type":"string","enum":["PERSON","EMAIL","PHONE","LOCATION","FINANCIAL","SECRET"]}},"replaceStyle":{"default":"tag","description":"tag writes <EMAIL>, mask writes * for each character, remove deletes it.","type":"string","enum":["tag","mask","remove"]}},"additionalProperties":false,"description":"Options for redactPII."}]},"profile":{"description":"Read the page with the cookies and local storage that earlier calls saved under this name, kept for your account for 30 days after the last use. A call with a profile always loads the page in a browser, costs $1 per 1,000 pages, the same as any page, and is never answered from a stored copy. Only one call at a time can save to a profile.","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128,"description":"A name you choose, such as shop-login. Calls with the same name share state."},"saveChanges":{"default":true,"description":"Keep the cookies and local storage this read leaves behind for the next call with this name. Send false to read with the profile without changing it.","type":"boolean"}},"required":["name"],"additionalProperties":false},"zeroDataRetention":{"default":false,"description":"Send true to keep nothing from this call: no stored copy is read or made, and nothing from it is logged. Adds $2 per 1,000 scraped URLs, not per PDF page. Not with a screenshot.","type":"boolean"},"linkStyle":{"default":"inline","description":"How links appear in the markdown. inline keeps [text](address). numbered writes Pricing⟨3⟩ and lists each address once at the end. none keeps only the link text, which makes link-heavy pages 10 to 70% shorter; ask for the links format to get the addresses.","type":"string","enum":["inline","numbered","none"]},"maxChars":{"description":"Cut the markdown at this many characters; isTruncated says when that happened and nextOffset where to read on. With query, how much of the page to keep, 8000 by default.","type":"integer","minimum":500,"maximum":1000000},"query":{"description":"What you are looking for on the page, such as refund window. A page longer than maxChars (8000 by default) comes back as the passages that match, in page order, each with the text around it and its table header; a shorter page comes back whole. Costs nothing extra, and a PDF is charged for the share of its pages that comes back. Not with offset.","type":"string","minLength":1,"maxLength":10000}},"required":["urls"],"additionalProperties":false},"example":{"urls":["https://bun.com/docs/runtime/bunfig","https://bun.com/docs/runtime/env"]}}}},"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"},"idempotent-replayed":{"$ref":"#/components/headers/IdempotentReplayed"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"success":{"type":"boolean","const":true},"id":{"type":"string"},"url":{"type":"string"},"status":{"type":"string","const":"scraping"},"queuePosition":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalidURLs":{"type":"array","items":{"type":"string"}}},"required":["success","invalidURLs"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"batchScrapeList","summary":"List your batch scrapes, newest first","description":"Costs $0 per 1,000 calls. Pages with cursor.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"status","in":"query","required":false,"schema":{"description":"Only jobs in this status.","type":"string","enum":["scraping","completed","cancelled","failed"]}},{"name":"limit","in":"query","required":false,"schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"description":"The cursor from the previous response. Send it as is."}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"batches":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["scraping","completed","cancelled","failed"]},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"completed":{"type":"integer","minimum":0,"maximum":9007199254740991},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991},"creditsUsed":{"type":"integer","minimum":0,"maximum":9007199254740991},"costUsd":{"type":"number"},"createdAt":{"type":"string"},"completedAt":{"type":"string"},"expiresAt":{"type":"string"},"message":{"type":"string"}},"required":["status","total","completed","failed","creditsUsed","costUsd"]}},"cursor":{"type":"string"}},"required":["batches"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/batch/scrape/{id}":{"get":{"operationId":"batchScrapeStatus","summary":"Check a batch scrape and read the finished pages","description":"Costs $0 per 1,000 calls. Pages with cursor.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"checkpoint","in":"query","required":false,"schema":{"description":"Send ck_start to start reading with checkpoints. Send the returned checkpoint here to resume, even when no more pages are ready.","type":"string","pattern":"^(?:ck_(?:start|[A-Za-z0-9_-]{20,32}))$"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"description":"The cursor from the previous response. Send it as is."}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"success":{"type":"boolean","const":true},"status":{"type":"string","enum":["scraping","completed","failed","cancelled"]},"queuePosition":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"timestamp":{"type":"string"},"url":{"type":"string"},"error":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"at":{"type":"string"}},"required":["retryable"]}},"creditsUsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"costUsd":{"type":"number"},"createdAt":{"type":"string"},"completedAt":{"type":"string"},"duration":{"type":"number"},"expiresAt":{"type":"string"},"next":{"type":"string"},"checkpoint":{"type":"string"},"data":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"markdown":{"type":"string"},"summary":{"type":"string"},"html":{"type":"string"},"rawHtml":{"type":"string"},"links":{"type":"array","items":{"type":"string"}},"images":{"type":"array","items":{"type":"string"}},"attributes":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"selector":{"type":"string"},"attribute":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":[]}},"screenshot":{"type":"string"},"json":{"$ref":"#/components/schemas/batchScrapeStatus.schema0"},"highlights":{"type":"string"},"isTruncated":{"type":"boolean"},"nextOffset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"changeTracking":{"type":"object","additionalProperties":false,"properties":{"previousScrapeAt":{"type":"string"},"changeStatus":{"type":"string","enum":["new","same","changed"]},"visibility":{"type":"string"},"diff":{"type":"string"}},"required":[]},"branding":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/batchScrapeStatus.schema0"}},"actions":{"type":"object","additionalProperties":false,"properties":{"screenshots":{"type":"array","items":{"type":"string"}},"scrapes":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string"},"html":{"type":"string"}},"required":[]}},"javascriptReturns":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string"},"value":{"$ref":"#/components/schemas/batchScrapeStatus.schema0"}},"required":[]}},"pdfs":{"type":"array","items":{"type":"string"}}},"required":[]},"warning":{"type":"string"},"metadata":{"type":"object","additionalProperties":{},"description":"Facts about the page. Named page facts such as ogTitle or keywords appear when the page has them, and every meta tag also appears under its own name, such as og:title.","properties":{"title":{"type":"string"},"description":{"type":"string"},"language":{"type":"string"},"ogImage":{"type":"string"},"sourceURL":{"type":"string"},"url":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contentType":{"type":"string"},"numPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cacheState":{"type":"string","enum":["hit","miss","stale"]},"cachedAt":{"type":"string"},"scrapeId":{"type":"string"},"creditsUsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"costUsd":{"type":"number"}},"required":["statusCode"]}},"required":["isTruncated","metadata"]}}},"required":["success","status","total","completed","failed","errors","creditsUsed","costUsd","data"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"batchScrapeCancel","summary":"Stop a batch scrape and keep the pages already read","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"status":{"type":"string","const":"cancelled"},"success":{"type":"boolean","const":true}},"required":["status","success"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/batch/scrape/{id}/errors":{"get":{"operationId":"batchScrapeErrors","summary":"List the pages a batch scrape could not read, and why","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"success":{"type":"boolean","const":true},"status":{"type":"string","enum":["scraping","completed","failed","cancelled"]},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"timestamp":{"type":"string"},"url":{"type":"string"},"error":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"at":{"type":"string"}},"required":["retryable"]}},"robotsBlocked":{"type":"array","items":{"type":"string"}},"isTruncated":{"type":"boolean"}},"required":["success","status","failed","errors","robotsBlocked"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/agent":{"post":{"operationId":"agent","summary":"Give it a task and it searches, reads pages and fills your fields, with a quote for each","description":"Costs each search and page at its normal price, plus $0.003 for each planning or answering step that returns something, never more than maxCredits. Each step is charged when it finishes. Starting the run is free.","x-credits":0,"x-credits-max":2500,"x-cost-usd":0,"x-cost-usd-max":5,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":10000,"description":"What to find, in plain words, such as the pricing tiers of Pinecone, Qdrant and Weaviate, or the CEO and headquarters city of each of these startups."},"urls":{"description":"Pages to start from, up to 20. An address with * in it, such as https://qdrant.tech/blog/*, is expanded from the site's own page list, up to 10 pages. Without urls the agent searches the web.","minItems":1,"maxItems":20,"type":"array","items":{"type":"string","maxLength":2048}},"schema":{"description":"The fields to fill, as a JSON Schema (draft-07 or 2020-12) object with properties. Pydantic's model_json_schema() and zod's toJSONSchema() output work as they are. enum, const, anyOf, oneOf, nullable types, $ref with $defs, required, descriptions and any key names are read. Up to 100 top-level fields and 32 KB. A field the page does not state comes back null.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/agent.input.schema0"}},"maxCredits":{"default":2500,"description":"The most this run may spend, counted in steps of $0.002. Default 2500, which is $5. Every step is checked against what is left before it runs, so the run never goes over. A run that cannot finish inside it fails with stopReason credit_limit_reached and what it found in partial. What it already spent is charged.","type":"number","exclusiveMinimum":0},"includeSources":{"default":true,"description":"Send false to leave sources out of the answer. They cost nothing.","type":"boolean"},"model":{"default":"stophy","description":"Any model name is accepted. Every name runs the same agent, and the name you send is echoed back.","type":"string","minLength":1,"maxLength":100},"mode":{"description":"extract (the default) fills your fields on every turn. chat lets a follow-up that asks for no new data get a short reply in message, for $0.003 per reply, instead of a new run. Needs threadId. A follow-up that omits mode keeps the thread's mode.","type":"string","enum":["extract","chat"]},"effort":{"description":"How many search-and-read rounds the agent may take: low 1, medium 2, high 3 (the default). A follow-up that omits effort keeps the thread's.","type":"string","enum":["low","medium","high"]},"location":{"description":"The country every search and page read goes out from, and results are localized to. A follow-up that omits location keeps the thread's.","type":"object","properties":{"country":{"description":"Two-letter country code, such as DE or JP.","type":"string","minLength":2,"maxLength":2}},"required":["country"]},"strictConstrainToURLs":{"description":"Send true to read only the pages in urls, with no searching. Needs urls, or a thread that has them.","type":"boolean"},"threadId":{"description":"Ask a follow-up in the same thread: send the threadId an earlier run returned. The run sees the earlier question and answer, and omitted urls, schema, effort, mode and location carry over.","type":"string","pattern":"^[A-Za-z0-9_-]{1,100}$"},"zeroDataRetention":{"description":"Send true to keep nothing from this run: the prompt, steps and result are held for one hour at most and nothing is logged. Each page read adds $2 per 1,000 pages. Cannot be sent with threadId.","type":"boolean"},"safe":{"description":"Send true to hide explicit results from every web search in the run. Pages in urls and pages the agent opens are not filtered. A follow-up that omits safe keeps the thread's.","type":"boolean"},"auditMetadata":{"description":"Who made the request, kept with the run and read back by agent.status.","type":"object","properties":{"username":{"type":"string","maxLength":1024}},"required":["username"],"additionalProperties":false},"webhook":{"description":"Where to be told about the job: a plain address, or { url } which gets a JSON POST when the job starts, for each finished page, and when the job ends. headers are sent with every call, metadata comes back in every call, and events picks which of started, page, action, completed, failed and cancelled to send (all by default). An agent run sends action for each step it takes, and page too. Every call is signed: read Stophy-Signature (t=<unix seconds>,v1=<hex>), where v1 is the HMAC-SHA256 of \"<t>.<body>\" with your webhook secret from webhook.secret. A call that gets no 2xx is sent again, up to 3 times. Every call has an eventId that stays the same when the call is sent again, so you can skip one you already handled. If your address answers slowly, a page event can carry only the page url. Read that page with the status call.","anyOf":[{"type":"string"},{"type":"object","properties":{"url":{"type":"string"},"headers":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9-]{1,64}$"},"additionalProperties":{"type":"string","maxLength":1000}},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/agent.input.schema0"}},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["started","page","action","completed","failed","cancelled"]}}},"required":["url"],"additionalProperties":false}]}},"required":["prompt"],"additionalProperties":false},"example":{"prompt":"What is the name of the configuration file this page describes?","urls":["https://bun.com/docs/runtime/bunfig"],"schema":{"type":"object","properties":{"file":{"type":"string"}}},"maxCredits":10}}}},"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"},"idempotent-replayed":{"$ref":"#/components/headers/IdempotentReplayed"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"success":{"type":"boolean","const":true},"id":{"type":"string"},"url":{"type":"string"},"status":{"type":"string","const":"scraping"},"queuePosition":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"threadId":{"type":"string"},"threadTurn":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["success","threadTurn"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"agentList","summary":"List your agent runs of the last 24 hours, newest first","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"before","in":"query","required":false,"schema":{"description":"Only runs made before this time, in unix milliseconds.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":20}},{"name":"origin","in":"query","required":false,"schema":{"description":"Accepted for compatibility. Does not filter runs.","type":"string","maxLength":200}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"success":{"type":"boolean","const":true},"agents":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"next":{"type":"string"}},"required":["success","agents"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/agent/{id}":{"get":{"operationId":"agentStatus","summary":"Check an agent run and read its answer","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"success":{"type":"boolean","const":true},"status":{"type":"string","enum":["processing","completed","failed"]},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"partial":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"partialSchemaValid":{"type":"boolean"},"stopReason":{"type":"string","const":"credit_limit_reached"},"error":{"type":"string"},"confidence":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"sources":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"message":{"type":"string"},"model":{"type":"string"},"mode":{"type":"string","enum":["extract","chat"]},"effort":{"type":"string","enum":["low","medium","high"]},"threadId":{"type":"string"},"threadTurn":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"steps":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"skipped":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"timestamp":{"type":"string"},"url":{"type":"string"},"error":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"at":{"type":"string"}},"required":["retryable"]}},"creditsUsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"costUsd":{"type":"number"}},"required":["success","status","mode","effort","threadTurn","steps","skipped","creditsUsed","costUsd"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"agentCancel","summary":"Stop an agent run and keep what it has read","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"status":{"type":"string","const":"cancelled"},"success":{"type":"boolean","const":true}},"required":["status","success"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/agent/{id}/trace":{"get":{"operationId":"agentTrace","summary":"Read every step an agent run took, in order","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"liveView","in":"query","required":false,"schema":{"description":"Accepted and not used: no run has a live view.","type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"success":{"type":"boolean","const":true},"id":{"type":"string"},"events":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"creditsUsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"costUsd":{"type":"number"}},"required":["success","events","creditsUsed","costUsd"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/agent/{id}/snapshots/{snapshotId}":{"get":{"operationId":"agentSnapshot","summary":"Read the answer an agent run had after one round","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"snapshotId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"success":{"type":"boolean","const":true},"id":{"type":"string"},"snapshotId":{"type":"string"},"snapshot":{"type":"string"},"snapshotData":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/agent/threads/{threadId}":{"get":{"operationId":"agentThread","summary":"Read every turn of one agent thread, oldest first","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"threadId","in":"path","required":true,"schema":{"type":"string"}},{"name":"includeData","in":"query","required":false,"schema":{"description":"Send true to include each finished run's data.","type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"success":{"type":"boolean","const":true},"thread":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success"]}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/webhook/secret":{"post":{"operationId":"webhookSecret","summary":"Read or replace the secret that signs your webhook calls","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rotate":{"default":false,"description":"Send true to replace the secret with a new one.","type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"},"idempotent-replayed":{"$ref":"#/components/headers/IdempotentReplayed"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"secret":{"type":"string"}},"required":[]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/batch/scrape/{id}/results":{"get":{"operationId":"batchScrapeResults","summary":"Read the finished pages of a batch scrape, a page of results at a time","description":"Costs $0 per 1,000 calls. Pages with cursor.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"description":"The cursor from the previous response. Send it as is."}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["scraping","completed","cancelled","failed"]},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"completed":{"type":"integer","minimum":0,"maximum":9007199254740991},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991},"creditsUsed":{"type":"integer","minimum":0,"maximum":9007199254740991},"costUsd":{"type":"number"},"message":{"type":"string"},"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"errors":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"default":false,"type":"boolean"},"at":{"type":"number"}},"required":["retryable"]}},"results":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"markdown":{"type":"string"},"pages":{"description":"For a PDF read with the pdf parser and pages true: each page's markdown.","type":"array","items":{"type":"object","additionalProperties":false,"properties":{"pageNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"markdown":{"type":"string"}},"required":["pageNumber"]}},"blocks":{"description":"For a PDF read with the pdf parser and blocks true: each title, section header or run of text with its page, order, bbox and span.","type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/batchScrapeResults.schema0"}}},"summary":{"description":"A short summary of the page.","type":"string"},"answer":{"description":"The answer to the question format. Left out, with a warning, when the page does not state one.","type":"string"},"product":{"description":"The product the page sells: title, brand, category, url, description and variants, each with its price, sale, availability and images. Left out, with a warning, when the page is not a product page.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"menu":{"description":"The menu on the page: isMenu, confidence, merchant, currency and sections with their items. Left out, with a warning, when the page is not a menu.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"html":{"type":"string"},"rawHtml":{"type":"string"},"audio":{"description":"A link to the audio of a YouTube video as an M4A file. The link works for 1 hour.","type":"string","format":"uri"},"video":{"description":"A link to a YouTube video as an MP4 file with sound, in the best single-file quality YouTube offers. The link works for 1 hour.","type":"string","format":"uri"},"rawBase64":{"description":"The bytes the site sent, Base64 encoded, without a data: prefix. metadata.contentType says what they are. Always read live.","type":"string"},"links":{"type":"array","items":{"type":"string"}},"images":{"type":"array","items":{"type":"string"}},"screenshot":{"description":"A link to a JPEG of the page. The link works for 7 days.","type":"string","format":"uri"},"screenshotCropped":{"description":"true when the page was taller than the screenshot, so the bottom is cut off.","type":"boolean"},"highlights":{"description":"The passages that best match the highlights query, best first.","type":"array","items":{"type":"object","additionalProperties":false,"properties":{"section":{"type":"string"},"text":{"type":"string"}},"required":[]}},"network":{"description":"The JSON responses the page loaded while it rendered, with their bodies.","type":"array","items":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string"},"method":{"type":"string"},"status":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contentType":{"type":"string"},"body":{"type":"string"}},"required":["status"]}},"branding":{"description":"The page's look: colorScheme, logo, colors (hex), fonts, typography, spacing, components, images and layout. Each field is left out or null when the page does not show it.","type":"object","additionalProperties":false,"properties":{"colorScheme":{"type":"string","enum":["light","dark"]},"logo":{"type":"string"},"colors":{"type":"object","additionalProperties":false,"properties":{"primary":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"secondary":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"accent":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"background":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"textPrimary":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"textSecondary":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"link":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"success":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"warning":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"error":{"type":"string","pattern":"^#[0-9a-f]{6}$"}},"required":[]},"fonts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"family":{"type":"string","minLength":1}},"required":["family"]}},"typography":{"type":"object","additionalProperties":false,"properties":{"fontFamilies":{"type":"object","additionalProperties":false,"properties":{"primary":{"type":"string","minLength":1},"heading":{"type":"string","minLength":1},"code":{"type":"string","minLength":1}},"required":[]},"fontSizes":{"type":"object","additionalProperties":false,"properties":{"h1":{"type":"string","minLength":1},"h2":{"type":"string","minLength":1},"h3":{"type":"string","minLength":1},"body":{"type":"string","minLength":1}},"required":[]},"fontWeights":{"type":"object","additionalProperties":false,"properties":{"light":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"regular":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"medium":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bold":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":[]},"lineHeights":{"type":"object","additionalProperties":false,"properties":{"heading":{"type":"string","minLength":1},"body":{"type":"string","minLength":1}},"required":[]}},"required":[]},"spacing":{"type":"object","additionalProperties":false,"properties":{"baseUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"borderRadius":{"type":"string","minLength":1},"padding":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}},"margins":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}}},"required":[]},"components":{"type":"object","additionalProperties":false,"properties":{"buttonPrimary":{"type":"object","additionalProperties":false,"properties":{"background":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"textColor":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"borderRadius":{"type":"string","minLength":1}},"required":[]},"buttonSecondary":{"type":"object","additionalProperties":false,"properties":{"background":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"textColor":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"borderColor":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"borderRadius":{"type":"string","minLength":1}},"required":[]},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}}},"required":[]},"icons":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}},"images":{"type":"object","additionalProperties":false,"properties":{"logo":{"type":"string"},"favicon":{"type":"string"},"ogImage":{"type":"string"}},"required":[]},"animations":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}},"layout":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}},"personality":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}}},"required":["colorScheme"]},"networkDropped":{"description":"How many JSON responses were left out because the page loaded too many or they were too big.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"json":{"description":"What you asked for with the json format. A page from a site Stophy reads natively, such as a Reddit post, comes back as its own data. Any other page comes back as the fields in your schema or prompt, each null when the page does not state it.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"changeTracking":{"description":"new the first time your key reads this page, same when nothing changed, changed with a unified diff of the markdown when something did. With json mode, json holds each field's previous and current value.","type":"object","additionalProperties":false,"properties":{"status":{"type":"string","enum":["new","same","changed"]},"previousAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"diff":{"type":"string"},"json":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","additionalProperties":false,"properties":{"previous":{"$ref":"#/components/schemas/batchScrapeResults.schema0"},"current":{"$ref":"#/components/schemas/batchScrapeResults.schema0"}},"required":[]}}},"required":["status"]},"attributes":{"description":"The values the attributes format read, one entry per selector.","type":"array","items":{"type":"object","additionalProperties":false,"properties":{"selector":{"type":"string"},"attribute":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":[]}},"actions":{"description":"What the screenshot, scrape, executeJavascript and pdf actions captured, each in the order the actions ran: screenshots and pdfs as links that work for 7 days, scrapes as the page url and html at that point, javascriptReturns as the type and value each script returned.","type":"object","additionalProperties":false,"properties":{"screenshots":{"type":"array","items":{"type":"string","format":"uri"}},"scrapes":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string"},"html":{"type":"string"}},"required":[]}},"javascriptReturns":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string"},"value":{}},"required":[]}},"pdfs":{"type":"array","items":{"type":"string","format":"uri"}}},"required":[]},"warning":{"description":"Set when an action failed: it names the action and says why. The rest of the answer is the page as it stood before that action. Also set when the site redirected the address to a page above it, such as a blog index for a removed post.","type":"string"},"isTruncated":{"type":"boolean"},"nextOffset":{"description":"Where the next part of the text starts, when more follows. Send it as offset, with the same maxChars, to read on.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"array","items":{"type":"string"}}]},"description":"Facts about the page: sourceURL is the address you sent and url is where it ended up after redirects. Named page facts such as ogTitle, publishedTime or keywords appear when the page has them, and every meta tag also appears under its own name, such as og:title.","properties":{"title":{"type":"string"},"description":{"type":"string"},"language":{"type":"string"},"ogImage":{"type":"string"},"sourceURL":{"type":"string"},"url":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contentType":{"type":"string"},"cacheState":{"type":"string","enum":["hit","miss","stale"]},"cachedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"numPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ocrPages":{"description":"PDF pages whose text was read from their picture.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"proxyUsed":{"description":"Which read got the page: basic or enhanced. null when a stored copy does not say.","type":"string","enum":["basic","enhanced"]}},"required":["statusCode","cacheState"]},"url":{"type":"string"},"creditsUsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"costUsd":{"type":"number"}},"required":["isTruncated","metadata","creditsUsed","costUsd"]}},"cursor":{"type":"string"}},"required":["status","total","completed","failed","creditsUsed","costUsd","results","errors"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"batchScrapeResultsDelete","summary":"Delete the stored results of a finished batch scrape","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"deletedPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["deletedPages"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/crawl/{id}/results":{"get":{"operationId":"crawlResults","summary":"Read the finished pages of a background crawl, a page of results at a time","description":"Costs $0 per 1,000 calls. Pages with cursor.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"description":"The cursor from the previous response. Send it as is."}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["scraping","completed","cancelled","failed"]},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"completed":{"type":"integer","minimum":0,"maximum":9007199254740991},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991},"creditsUsed":{"type":"integer","minimum":0,"maximum":9007199254740991},"costUsd":{"type":"number"},"message":{"type":"string"},"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"errors":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retryable":{"default":false,"type":"boolean"},"at":{"type":"number"}},"required":["retryable"]}},"results":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"markdown":{"type":"string"},"pages":{"description":"For a PDF read with the pdf parser and pages true: each page's markdown.","type":"array","items":{"type":"object","additionalProperties":false,"properties":{"pageNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"markdown":{"type":"string"}},"required":["pageNumber"]}},"blocks":{"description":"For a PDF read with the pdf parser and blocks true: each title, section header or run of text with its page, order, bbox and span.","type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/crawlResults.schema0"}}},"summary":{"description":"A short summary of the page.","type":"string"},"answer":{"description":"The answer to the question format. Left out, with a warning, when the page does not state one.","type":"string"},"product":{"description":"The product the page sells: title, brand, category, url, description and variants, each with its price, sale, availability and images. Left out, with a warning, when the page is not a product page.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"menu":{"description":"The menu on the page: isMenu, confidence, merchant, currency and sections with their items. Left out, with a warning, when the page is not a menu.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"html":{"type":"string"},"rawHtml":{"type":"string"},"audio":{"description":"A link to the audio of a YouTube video as an M4A file. The link works for 1 hour.","type":"string","format":"uri"},"video":{"description":"A link to a YouTube video as an MP4 file with sound, in the best single-file quality YouTube offers. The link works for 1 hour.","type":"string","format":"uri"},"rawBase64":{"description":"The bytes the site sent, Base64 encoded, without a data: prefix. metadata.contentType says what they are. Always read live.","type":"string"},"links":{"type":"array","items":{"type":"string"}},"images":{"type":"array","items":{"type":"string"}},"screenshot":{"description":"A link to a JPEG of the page. The link works for 7 days.","type":"string","format":"uri"},"screenshotCropped":{"description":"true when the page was taller than the screenshot, so the bottom is cut off.","type":"boolean"},"highlights":{"description":"The passages that best match the highlights query, best first.","type":"array","items":{"type":"object","additionalProperties":false,"properties":{"section":{"type":"string"},"text":{"type":"string"}},"required":[]}},"network":{"description":"The JSON responses the page loaded while it rendered, with their bodies.","type":"array","items":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string"},"method":{"type":"string"},"status":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contentType":{"type":"string"},"body":{"type":"string"}},"required":["status"]}},"branding":{"description":"The page's look: colorScheme, logo, colors (hex), fonts, typography, spacing, components, images and layout. Each field is left out or null when the page does not show it.","type":"object","additionalProperties":false,"properties":{"colorScheme":{"type":"string","enum":["light","dark"]},"logo":{"type":"string"},"colors":{"type":"object","additionalProperties":false,"properties":{"primary":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"secondary":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"accent":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"background":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"textPrimary":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"textSecondary":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"link":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"success":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"warning":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"error":{"type":"string","pattern":"^#[0-9a-f]{6}$"}},"required":[]},"fonts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"family":{"type":"string","minLength":1}},"required":["family"]}},"typography":{"type":"object","additionalProperties":false,"properties":{"fontFamilies":{"type":"object","additionalProperties":false,"properties":{"primary":{"type":"string","minLength":1},"heading":{"type":"string","minLength":1},"code":{"type":"string","minLength":1}},"required":[]},"fontSizes":{"type":"object","additionalProperties":false,"properties":{"h1":{"type":"string","minLength":1},"h2":{"type":"string","minLength":1},"h3":{"type":"string","minLength":1},"body":{"type":"string","minLength":1}},"required":[]},"fontWeights":{"type":"object","additionalProperties":false,"properties":{"light":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"regular":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"medium":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bold":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":[]},"lineHeights":{"type":"object","additionalProperties":false,"properties":{"heading":{"type":"string","minLength":1},"body":{"type":"string","minLength":1}},"required":[]}},"required":[]},"spacing":{"type":"object","additionalProperties":false,"properties":{"baseUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"borderRadius":{"type":"string","minLength":1},"padding":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}},"margins":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}}},"required":[]},"components":{"type":"object","additionalProperties":false,"properties":{"buttonPrimary":{"type":"object","additionalProperties":false,"properties":{"background":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"textColor":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"borderRadius":{"type":"string","minLength":1}},"required":[]},"buttonSecondary":{"type":"object","additionalProperties":false,"properties":{"background":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"textColor":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"borderColor":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"borderRadius":{"type":"string","minLength":1}},"required":[]},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}}},"required":[]},"icons":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}},"images":{"type":"object","additionalProperties":false,"properties":{"logo":{"type":"string"},"favicon":{"type":"string"},"ogImage":{"type":"string"}},"required":[]},"animations":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}},"layout":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}},"personality":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1}}},"required":["colorScheme"]},"networkDropped":{"description":"How many JSON responses were left out because the page loaded too many or they were too big.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"json":{"description":"What you asked for with the json format. A page from a site Stophy reads natively, such as a Reddit post, comes back as its own data. Any other page comes back as the fields in your schema or prompt, each null when the page does not state it.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"changeTracking":{"description":"new the first time your key reads this page, same when nothing changed, changed with a unified diff of the markdown when something did. With json mode, json holds each field's previous and current value.","type":"object","additionalProperties":false,"properties":{"status":{"type":"string","enum":["new","same","changed"]},"previousAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"diff":{"type":"string"},"json":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","additionalProperties":false,"properties":{"previous":{"$ref":"#/components/schemas/crawlResults.schema0"},"current":{"$ref":"#/components/schemas/crawlResults.schema0"}},"required":[]}}},"required":["status"]},"attributes":{"description":"The values the attributes format read, one entry per selector.","type":"array","items":{"type":"object","additionalProperties":false,"properties":{"selector":{"type":"string"},"attribute":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":[]}},"actions":{"description":"What the screenshot, scrape, executeJavascript and pdf actions captured, each in the order the actions ran: screenshots and pdfs as links that work for 7 days, scrapes as the page url and html at that point, javascriptReturns as the type and value each script returned.","type":"object","additionalProperties":false,"properties":{"screenshots":{"type":"array","items":{"type":"string","format":"uri"}},"scrapes":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string"},"html":{"type":"string"}},"required":[]}},"javascriptReturns":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string"},"value":{}},"required":[]}},"pdfs":{"type":"array","items":{"type":"string","format":"uri"}}},"required":[]},"warning":{"description":"Set when an action failed: it names the action and says why. The rest of the answer is the page as it stood before that action. Also set when the site redirected the address to a page above it, such as a blog index for a removed post.","type":"string"},"nextOffset":{"description":"Where the next part of the text starts, when more follows. Send it as offset, with the same maxChars, to read on.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"},"requestedUrl":{"type":"string"},"title":{"type":"string"},"depth":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"isTruncated":{"type":"boolean"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"array","items":{"type":"string"}}]}},"creditsUsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"costUsd":{"type":"number"}},"required":["depth","creditsUsed","costUsd"]}},"cursor":{"type":"string"}},"required":["status","total","completed","failed","creditsUsed","costUsd","results","errors"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/monitor/changes":{"get":{"operationId":"monitorChangesAll","summary":"List the changes found by all your monitors, newest first","description":"Costs $0 per 1,000 calls. Pages with cursor.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"monitorId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":60,"description":"The monitor id from monitor.create."}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["new","same","changed","removed"]}},{"name":"url","in":"query","required":false,"schema":{"description":"Only changes of this page address.","type":"string","minLength":1,"maxLength":2000}},{"name":"limit","in":"query","required":false,"schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"description":"The cursor from the previous response. Send it as is."}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"changes":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"monitorId":{"type":"string"},"monitorName":{"type":"string"},"at":{"type":"string","description":"When the page was read. Changes are listed in the order they were recorded, newest first."},"url":{"type":"string"},"changeStatus":{"type":"string","enum":["new","same","changed","removed"]},"creditsUsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"costUsd":{"type":"number"},"error":{"type":"string"}},"required":["creditsUsed","costUsd"]}},"cursor":{"type":"string"}},"required":["changes"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/monitor/changes/{id}":{"get":{"operationId":"monitorChange","summary":"Read one change of a monitor with its diff","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"monitorId":{"type":"string"},"monitorName":{"type":"string"},"at":{"type":"string","description":"When the page was read. Changes are listed in the order they were recorded, newest first."},"url":{"type":"string"},"changeStatus":{"type":"string","enum":["new","same","changed","removed"]},"creditsUsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"costUsd":{"type":"number"},"error":{"type":"string"},"diff":{"type":"string"},"json":{"type":"object","additionalProperties":false,"properties":{"before":{"$ref":"#/components/schemas/monitorChange.schema0"},"after":{"$ref":"#/components/schemas/monitorChange.schema0"}},"required":[]}},"required":["creditsUsed","costUsd"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/monitor/checks":{"get":{"operationId":"monitorChecksAll","summary":"List the check runs of all your monitors, newest first","description":"Costs $0 per 1,000 calls. Pages with cursor.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"monitorId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":60,"description":"The monitor id from monitor.create."}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["queued","running","completed","failed","partial","skipped_overlap","skipped_no_credits"]}},{"name":"trigger","in":"query","required":false,"schema":{"type":"string","enum":["scheduled","manual"]}},{"name":"limit","in":"query","required":false,"schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"description":"The cursor from the previous response. Send it as is."}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"checks":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"cursor":{"type":"string"}},"required":["checks"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/monitor/limits":{"get":{"operationId":"monitorLimits","summary":"See how many monitors and pages you may watch and how much you use","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"monitors":{"type":"object","additionalProperties":false,"properties":{"used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["used","limit","active"]},"pages":{"type":"object","additionalProperties":false,"properties":{"used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["used","limit"]},"perMonitor":{"type":"object","additionalProperties":false,"properties":{"pages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"targets":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["pages","targets"]},"intervalSeconds":{"type":"object","additionalProperties":false,"properties":{"min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["min","max"]},"estimatedCreditsPerMonth":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["monitors","pages","perMonitor","intervalSeconds","estimatedCreditsPerMonth"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/monitor/usage":{"get":{"operationId":"monitorUsage","summary":"See what each monitor cost over a window, in dollars","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"from","in":"query","required":false,"schema":{"description":"Start of the window. Defaults to the start of the default span.","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}]}},{"name":"to","in":"query","required":false,"schema":{"description":"End of the window, not included. Defaults to now.","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}]}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"from":{"type":"string"},"to":{"type":"string"},"totalCredits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalCostUsd":{"type":"number"},"monitors":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"name":{"type":"string"},"credits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"costUsd":{"type":"number"},"charges":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deleted":{"type":"boolean"}},"required":["credits","costUsd","charges","deleted"]}}},"required":["totalCredits","totalCostUsd","monitors"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/monitor/{id}/webhook/rotate-secret":{"post":{"operationId":"monitorWebhookRotate-secret","summary":"Give one monitor's webhook calls a new signing secret","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"$ref":"#/components/parameters/IdempotencyKey"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"},"idempotent-replayed":{"$ref":"#/components/headers/IdempotentReplayed"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"secret":{"type":"string"}},"required":[]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/webhook/deliveries":{"get":{"operationId":"webhookDeliveries","summary":"List the webhook calls we sent for your batches, crawls, agents and monitors","description":"Costs $0 per 1,000 calls. Pages with cursor.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"sourceType","in":"query","required":false,"schema":{"description":"Only calls for this kind of job.","type":"string","enum":["batch","crawl","agent","monitor","extract"]}},{"name":"sourceId","in":"query","required":false,"schema":{"description":"Only calls for this job or monitor id.","type":"string","minLength":1,"maxLength":120}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["delivered","failed","skipped"]}},{"name":"event","in":"query","required":false,"schema":{"description":"Only this event, such as completed.","type":"string","minLength":1,"maxLength":60}},{"name":"limit","in":"query","required":false,"schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"description":"The cursor from the previous response. Send it as is."}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"deliveries":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"sourceType":{"type":"string"},"sourceId":{"type":"string"},"event":{"type":"string"},"url":{"type":"string"},"status":{"type":"string","enum":["delivered","failed","skipped"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"lastAttemptAt":{"type":"string"},"lastStatusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["status","attempts"]}},"cursor":{"type":"string"}},"required":["deliveries"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/webhook/deliveries/{id}":{"get":{"operationId":"webhookDelivery","summary":"Read one webhook call: its status and the payload we sent","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"sourceType":{"type":"string"},"sourceId":{"type":"string"},"event":{"type":"string"},"url":{"type":"string"},"status":{"type":"string","enum":["delivered","failed","skipped"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"lastAttemptAt":{"type":"string"},"lastStatusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"payload":{"type":"string"},"payloadKeptUntil":{"type":"string"}},"required":["status","attempts"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/webhook/deliveries/{id}/attempts":{"get":{"operationId":"webhookDeliveryAttempts","summary":"List every try of one webhook call, oldest first","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"attempts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"at":{"type":"string"},"ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"type":"string"},"trigger":{"type":"string","enum":["auto","manual"]}},"required":["ms","trigger"]}}},"required":["attempts"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/webhook/deliveries/{id}/retry":{"post":{"operationId":"webhookDeliveryRetry","summary":"Send the original payload of a webhook call again","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"$ref":"#/components/parameters/IdempotencyKey"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"},"idempotent-replayed":{"$ref":"#/components/headers/IdempotentReplayed"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["delivered","failed","skipped"]},"attempt":{"type":"object","additionalProperties":false,"properties":{"at":{"type":"string"},"ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"type":"string"},"trigger":{"type":"string","enum":["auto","manual"]}},"required":["ms","trigger"]}},"required":["status","attempt"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/logs/{id}":{"get":{"operationId":"logsGet","summary":"Read what one of your paid requests was and what it cost","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"days","in":"query","required":false,"schema":{"default":7,"description":"How many days back to look, 1 to 90. Default 7.","type":"integer","minimum":1,"maximum":90}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"requestId":{"type":"string"},"createdAt":{"type":"string"},"endpoint":{"type":"string"},"credits":{"type":"number"},"costUsd":{"type":"number"},"charges":{"type":"integer","minimum":0,"maximum":9007199254740991},"apiKeyId":{"type":"string"},"apiKeyName":{"type":"string"}},"required":["credits","costUsd","charges"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}},"/v1/usage/history":{"get":{"operationId":"usageHistory","summary":"See what you spent and the paid requests you made per hour, day or month","description":"Costs $0 per 1,000 calls.","x-credits":0,"x-cost-usd":0,"parameters":[{"$ref":"#/components/parameters/MaxTextLength"},{"name":"interval","in":"query","required":false,"schema":{"default":"day","type":"string","enum":["hour","day","month"]}},{"name":"from","in":"query","required":false,"schema":{"description":"Start of the window. Defaults to the start of the default span.","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}]}},{"name":"to","in":"query","required":false,"schema":{"description":"End of the window, not included. Defaults to now.","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}]}},{"name":"endpoint","in":"query","required":false,"schema":{"description":"Only calls to this endpoint id.","type":"string","minLength":1,"maxLength":80}},{"name":"apiKeyId","in":"query","required":false,"schema":{"description":"Only calls made with this key.","type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"The data, and what this call cost in dollars.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"x-credits-used":{"$ref":"#/components/headers/CreditsUsed"},"x-cost-usd":{"$ref":"#/components/headers/CostUsd"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"x-cache":{"$ref":"#/components/headers/Cache"},"x-cache-age":{"$ref":"#/components/headers/CacheAge"}},"content":{"application/json":{"schema":{"type":"object","required":["success","data","costUsd","creditsUsed","requestId"],"properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"properties":{"interval":{"type":"string","enum":["hour","day","month"]},"from":{"type":"string"},"to":{"type":"string"},"totals":{"type":"object","additionalProperties":false,"properties":{"credits":{"type":"number"},"costUsd":{"type":"number"},"requests":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["credits","costUsd","requests"]},"buckets":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"start":{"type":"string"},"credits":{"type":"number"},"costUsd":{"type":"number"},"requests":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["credits","costUsd","requests"]}}},"required":["interval","totals","buckets"]},"creditsUsed":{"type":"integer"},"costUsd":{"type":"number","description":"What this call cost, in dollars."},"requestId":{"type":"string"}}}}}},"4XX":{"$ref":"#/components/responses/Error"},"5XX":{"$ref":"#/components/responses/Error"}}}}}}