{"openapi":"3.1.0","info":{"title":"SEOScraper API","version":"1.0"},"paths":{"/v1/scrape":{"post":{"tags":["scrape"],"summary":"Scrape a single page","description":"Costs one token. The token is returned when the page cannot be fetched.","operationId":"scrape","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScrapeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScrapeResult"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"`invalid_request`, `invalid_url`, `url_not_allowed`, `unsupported_content`, `too_many_redirects`, `dns_error`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"`rate_limited`, `no_tokens`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"`fetch_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"`busy`, `scraper_unavailable`, `unavailable`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"504":{"description":"`timeout`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/scrapes/{scrape_id}":{"get":{"tags":["scrape"],"summary":"Get a saved scrape","operationId":"get_scrape","security":[{"HTTPBearer":[]}],"parameters":[{"name":"scrape_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Result identifier.","title":"Scrape Id"},"description":"Result identifier."},{"name":"include_html","in":"query","required":false,"schema":{"type":"boolean","description":"Return raw HTML in the response.","default":false,"title":"Include Html"},"description":"Return raw HTML in the response."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScrapeResult"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["scrape"],"summary":"Delete a saved scrape","operationId":"delete_scrape","security":[{"HTTPBearer":[]}],"parameters":[{"name":"scrape_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Result identifier.","title":"Scrape Id"},"description":"Result identifier."}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/crawls":{"post":{"tags":["crawl"],"summary":"Start a crawl","description":"Returns immediately. Check the progress with `GET /v1/crawls/{id}`.\n\nReserves `max_pages` tokens, or fewer when you have fewer. Unused tokens return when the crawl ends.","operationId":"start_crawl","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlOptions"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Crawl"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"`rate_limited`, `no_tokens`, `too_many_crawls`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"`unavailable`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/crawls/{crawl_id}":{"get":{"tags":["crawl"],"summary":"Get crawl status","operationId":"get_crawl","security":[{"HTTPBearer":[]}],"parameters":[{"name":"crawl_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Crawl identifier.","title":"Crawl Id"},"description":"Crawl identifier."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Crawl"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["crawl"],"summary":"Delete a crawl and its results","operationId":"delete_crawl","security":[{"HTTPBearer":[]}],"parameters":[{"name":"crawl_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Crawl identifier.","title":"Crawl Id"},"description":"Crawl identifier."}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/crawls/{crawl_id}/retry":{"post":{"tags":["crawl"],"summary":"Retry selected pages","description":"Fetches the selected pages again and replaces them in the results of this crawl.\n\nReturns a separate crawl with its own id, progress and tokens. When it ends, read the results of the original crawl.","operationId":"retry_pages","security":[{"HTTPBearer":[]}],"parameters":[{"name":"crawl_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Crawl identifier.","title":"Crawl Id"},"description":"Crawl identifier."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetryRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Crawl"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"`crawl_not_ready`, `retry_in_progress`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"`rate_limited`, `no_tokens`, `too_many_crawls`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"`unavailable`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/crawls/{crawl_id}/cancel":{"post":{"tags":["crawl"],"summary":"Stop a crawl","description":"Already collected pages are kept.","operationId":"cancel_crawl","security":[{"HTTPBearer":[]}],"parameters":[{"name":"crawl_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Crawl identifier.","title":"Crawl Id"},"description":"Crawl identifier."}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Crawl"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"`forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/crawls/{crawl_id}/pages":{"get":{"tags":["crawl"],"summary":"List crawled pages","operationId":"list_pages","security":[{"HTTPBearer":[]}],"parameters":[{"name":"crawl_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Crawl identifier.","title":"Crawl Id"},"description":"Crawl identifier."},{"name":"sort","in":"query","required":false,"schema":{"enum":["id","url","status","title","depth","words","time","size"],"type":"string","description":"Field to sort by.","default":"id","title":"Sort"},"description":"Field to sort by."},{"name":"desc","in":"query","required":false,"schema":{"type":"boolean","description":"Sort in descending order.","default":false,"title":"Desc"},"description":"Sort in descending order."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Number of pages to return.","default":50,"title":"Limit"},"description":"Number of pages to return."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","maximum":100000,"minimum":0,"description":"Number of pages to skip.","default":0,"title":"Offset"},"description":"Number of pages to skip."},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200,"description":"Text in the URL or title. With `*` it is a path pattern, e.g. `/blog/*`.","default":"","title":"Q"},"description":"Text in the URL or title. With `*` it is a path pattern, e.g. `/blog/*`."},{"name":"issue","in":"query","required":false,"schema":{"anyOf":[{"enum":["ok","client_error","too_many_requests","server_error","failed","robots_blocked","redirected","noindex","missing_title","long_title","duplicate_title","missing_description","long_description","duplicate_description","missing_h1","multiple_h1","other_canonical","missing_alt","slow"],"type":"string"},{"type":"null"}],"description":"Only pages with this issue.","title":"Issue"},"description":"Only pages with this issue."},{"name":"filter","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","minLength":1,"maxLength":400},"maxItems":10,"description":"Conditions written as `field:operator:value`, e.g. `path:pattern:/blog/*` or `words:gte:300`.","default":[],"title":"Filter"},"description":"Conditions written as `field:operator:value`, e.g. `path:pattern:/blog/*` or `words:gte:300`."},{"name":"match","in":"query","required":false,"schema":{"enum":["all","any"],"type":"string","description":"Should a page meet all filters or any of them.","default":"all","title":"Match"},"description":"Should a page meet all filters or any of them."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlPages"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"`crawl_not_ready`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"`invalid_request`, `invalid_filter`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/crawls/{crawl_id}/urls":{"get":{"tags":["crawl"],"summary":"List URLs of matching pages","description":"All of them at once, without paging.","operationId":"list_urls","security":[{"HTTPBearer":[]}],"parameters":[{"name":"crawl_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Crawl identifier.","title":"Crawl Id"},"description":"Crawl identifier."},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200,"description":"Text in the URL or title. With `*` it is a path pattern, e.g. `/blog/*`.","default":"","title":"Q"},"description":"Text in the URL or title. With `*` it is a path pattern, e.g. `/blog/*`."},{"name":"issue","in":"query","required":false,"schema":{"anyOf":[{"enum":["ok","client_error","too_many_requests","server_error","failed","robots_blocked","redirected","noindex","missing_title","long_title","duplicate_title","missing_description","long_description","duplicate_description","missing_h1","multiple_h1","other_canonical","missing_alt","slow"],"type":"string"},{"type":"null"}],"description":"Only pages with this issue.","title":"Issue"},"description":"Only pages with this issue."},{"name":"filter","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","minLength":1,"maxLength":400},"maxItems":10,"description":"Conditions written as `field:operator:value`, e.g. `path:pattern:/blog/*` or `words:gte:300`.","default":[],"title":"Filter"},"description":"Conditions written as `field:operator:value`, e.g. `path:pattern:/blog/*` or `words:gte:300`."},{"name":"match","in":"query","required":false,"schema":{"enum":["all","any"],"type":"string","description":"Should a page meet all filters or any of them.","default":"all","title":"Match"},"description":"Should a page meet all filters or any of them."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlUrls"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"`crawl_not_ready`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"`invalid_request`, `invalid_filter`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/crawls/{crawl_id}/extract":{"post":{"tags":["crawl"],"summary":"Extract data with CSS selectors","description":"Works on the saved HTML, so the crawl needs `include_html`. Repeat with `next_offset` until it is null.","operationId":"extract","security":[{"HTTPBearer":[]}],"parameters":[{"name":"crawl_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Crawl identifier.","title":"Crawl Id"},"description":"Crawl identifier."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractResult"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"`crawl_not_ready`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"`invalid_request`, `invalid_filter`, `invalid_selector`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/crawls/{crawl_id}/pages/{page_id}":{"get":{"tags":["crawl"],"summary":"Get one crawled page","operationId":"get_page","security":[{"HTTPBearer":[]}],"parameters":[{"name":"crawl_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Crawl identifier.","title":"Crawl Id"},"description":"Crawl identifier."},{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","maximum":2147483648,"minimum":1,"description":"Page number in the crawl.","title":"Page Id"},"description":"Page number in the crawl."},{"name":"include_html","in":"query","required":false,"schema":{"type":"boolean","description":"Return raw HTML in the response.","default":false,"title":"Include Html"},"description":"Return raw HTML in the response."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlPageDetail"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"`crawl_not_ready`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/crawls/{crawl_id}/download":{"get":{"tags":["crawl"],"summary":"Download the SQLite file","description":"The file is sent with `Content-Encoding: gzip`. With curl use `-L --compressed`.","operationId":"download","security":[{"HTTPBearer":[]}],"parameters":[{"name":"crawl_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Crawl identifier.","title":"Crawl Id"},"description":"Crawl identifier."}],"responses":{"200":{"description":"SQLite file","content":{"application/vnd.sqlite3":{"schema":{"type":"string","format":"binary"}}}},"307":{"description":"Redirect to the file"},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"`crawl_not_ready`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/tokens":{"get":{"tags":["tokens"],"summary":"Get your token balance","operationId":"get_tokens","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tokens"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]}]}}},"components":{"schemas":{"Crawl":{"properties":{"id":{"type":"string","title":"Id","description":"Crawl identifier."},"status":{"type":"string","enum":["queued","running","completed","canceled","failed"],"title":"Status"},"url":{"type":"string","title":"Url","description":"Start address."},"options":{"$ref":"#/components/schemas/CrawlOptions","description":"Options the crawl was started with."},"mode":{"anyOf":[{"type":"string","enum":["sitemap","links"]},{"type":"null"}],"title":"Mode","description":"Where the URLs come from. null until the crawl starts."},"pages_done":{"type":"integer","title":"Pages Done","description":"Visited pages."},"pages_failed":{"type":"integer","title":"Pages Failed","description":"Pages without a response. Included in pages_done."},"pages_found":{"type":"integer","title":"Pages Found","description":"Visited pages and pages waiting in the queue."},"recent":{"items":{"$ref":"#/components/schemas/RecentPage"},"type":"array","title":"Recent","description":"Recently visited pages."},"stop_reason":{"anyOf":[{"type":"string","enum":["finished","max_pages","no_tokens","max_time","throttled","canceled","interrupted"]},{"type":"null"}],"title":"Stop Reason","description":"Why the crawl ended. null until then."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error code of a failed crawl."},"summary":{"anyOf":[{"$ref":"#/components/schemas/CrawlSummary"},{"type":"null"}],"description":"Ready when the crawl ends."},"file_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size","description":"Size of the compressed SQLite file in bytes."},"page_limit":{"type":"integer","title":"Page Limit","description":"Reserved tokens. Less than max_pages when you had fewer tokens."},"throttle":{"anyOf":[{"$ref":"#/components/schemas/CrawlThrottle"},{"type":"null"}],"description":"Set when the site answered 429 and the crawl slowed down."},"retry_of":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Retry Of","description":"Crawl whose pages this one fetches again. null for a regular crawl."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the crawl was added to the queue."},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At","description":"When the crawl left the queue."},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished At","description":"When the crawl ended."}},"type":"object","required":["id","status","url","options","mode","pages_done","pages_failed","pages_found","recent","stop_reason","error","summary","file_size","page_limit","throttle","retry_of","created_at","started_at","finished_at"],"title":"Crawl"},"CrawlOptions":{"properties":{"url":{"type":"string","maxLength":2048,"minLength":1,"title":"Url","description":"Start address. Without a scheme, https:// is added.","examples":["https://example.com"]},"source":{"type":"string","enum":["auto","sitemap","links"],"title":"Source","description":"auto: sitemap URLs, or links when there is no sitemap. sitemap: sitemap only. links: links only.","default":"auto"},"max_pages":{"type":"integer","maximum":10000.0,"minimum":1.0,"title":"Max Pages","description":"Page limit.","default":100},"max_depth":{"type":"integer","maximum":50.0,"minimum":0.0,"title":"Max Depth","description":"Clicks from the start page. Ignored for sitemaps.","default":5},"concurrency":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Concurrency","description":"Pages fetched at the same time.","default":5},"delay_ms":{"type":"integer","maximum":10000.0,"minimum":0.0,"title":"Delay Ms","description":"Pause between requests in milliseconds.","default":0},"include_subdomains":{"type":"boolean","title":"Include Subdomains","description":"Visit subdomains too.","default":false},"respect_robots":{"type":"boolean","title":"Respect Robots","description":"Obey robots.txt, including Crawl-delay.","default":true},"follow_nofollow":{"type":"boolean","title":"Follow Nofollow","description":"Follow nofollow links too.","default":false},"ignore_query":{"type":"boolean","title":"Ignore Query","description":"Treat /a?x=1 and /a as the same page.","default":false},"include_html":{"type":"boolean","title":"Include Html","description":"Save raw HTML in the result file.","default":true},"include_paths":{"items":{"type":"string","maxLength":200,"minLength":1},"type":"array","maxItems":20,"title":"Include Paths","description":"Crawl only these paths. Matches the beginning of the path, like in robots.txt. `*` is any text, `$` is the end.","default":[]},"exclude_paths":{"items":{"type":"string","maxLength":200,"minLength":1},"type":"array","maxItems":20,"title":"Exclude Paths","description":"Skip these paths. Matches the beginning of the path, like in robots.txt. `*` is any text, `$` is the end.","default":[]}},"type":"object","required":["url"],"title":"CrawlOptions"},"CrawlPage":{"properties":{"id":{"type":"integer","title":"Id","description":"Page number in the crawl."},"url":{"type":"string","title":"Url","description":"Address of the page."},"final_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final Url","description":"Address after all redirects."},"status":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status","description":"null when the page could not be fetched."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error code when the page could not be fetched."},"depth":{"type":"integer","title":"Depth","description":"Clicks from the start page."},"found_on":{"type":"string","title":"Found On","description":"Page with the first link to this one."},"title":{"type":"string","title":"Title","description":"Content of the title tag."},"meta_description":{"type":"string","title":"Meta Description","description":"Content of the meta description."},"canonical":{"type":"string","title":"Canonical","description":"Canonical address."},"index":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Index","description":"Whether the page may be indexed."},"word_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Word Count","description":"Number of words in the page content."},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms","description":"Fetch time in milliseconds."},"size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size Bytes","description":"Size of the fetched content in bytes."},"redirects":{"type":"integer","title":"Redirects","description":"Number of redirects."},"h1":{"type":"integer","title":"H1","description":"Number of h1 headings."},"links":{"type":"integer","title":"Links","description":"Number of links."},"missing_alt":{"type":"integer","title":"Missing Alt","description":"Number of images without the alt attribute."}},"type":"object","required":["id","url","final_url","status","error","depth","found_on","title","meta_description","canonical","index","word_count","duration_ms","size_bytes","redirects","h1","links","missing_alt"],"title":"CrawlPage"},"CrawlPageDetail":{"properties":{"page":{"$ref":"#/components/schemas/CrawlPage","description":"The same data as in the list of pages."},"data":{"anyOf":[{"$ref":"#/components/schemas/PageData"},{"type":"null"}],"description":"null when the page could not be fetched."}},"type":"object","required":["page","data"],"title":"CrawlPageDetail"},"CrawlPages":{"properties":{"total":{"type":"integer","title":"Total","description":"Number of pages that meet the conditions."},"pages":{"items":{"$ref":"#/components/schemas/CrawlPage"},"type":"array","title":"Pages"}},"type":"object","required":["total","pages"],"title":"CrawlPages"},"CrawlSummary":{"properties":{"avg_duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Avg Duration Ms","description":"Average fetch time in milliseconds."},"issues":{"additionalProperties":{"type":"integer"},"type":"object","title":"Issues","description":"Number of pages with each issue. Keys are values of the issue parameter."}},"type":"object","required":["avg_duration_ms","issues"],"title":"CrawlSummary"},"CrawlThrottle":{"properties":{"count":{"type":"integer","title":"Count","description":"Number of pauses."},"delay_ms":{"type":"integer","title":"Delay Ms","description":"Pause between requests after slowing down, in milliseconds."},"resume_at":{"type":"string","format":"date-time","title":"Resume At","description":"End of the latest pause. In the future: the crawl is waiting."}},"type":"object","required":["count","delay_ms","resume_at"],"title":"CrawlThrottle"},"CrawlUrl":{"properties":{"id":{"type":"integer","title":"Id","description":"Page number in the crawl."},"url":{"type":"string","title":"Url","description":"Address of the page."}},"type":"object","required":["id","url"],"title":"CrawlUrl"},"CrawlUrls":{"properties":{"pages":{"items":{"$ref":"#/components/schemas/CrawlUrl"},"type":"array","title":"Pages"}},"type":"object","required":["pages"],"title":"CrawlUrls"},"ErrorInfo":{"properties":{"code":{"type":"string","title":"Code","description":"Stable code for your program."},"message":{"type":"string","title":"Message","description":"Message for people. It may change."}},"type":"object","required":["code","message"],"title":"ErrorInfo"},"ErrorResponse":{"properties":{"error":{"$ref":"#/components/schemas/ErrorInfo"}},"type":"object","required":["error"],"title":"ErrorResponse"},"ExtractField":{"properties":{"name":{"type":"string","maxLength":60,"minLength":1,"title":"Name","description":"Name of the field in the result.","examples":["heading"]},"selector":{"type":"string","maxLength":500,"minLength":1,"title":"Selector","description":"CSS selector.","examples":["article h2"]},"format":{"type":"string","enum":["text","markdown","html","clean_html","attribute"],"title":"Format","description":"clean_html: no attributes, styles and scripts. attribute: value of the attribute in `attribute`.","default":"text"},"attribute":{"anyOf":[{"type":"string","pattern":"^[A-Za-z_][\\w:.-]{0,59}$"},{"type":"null"}],"title":"Attribute","description":"Attribute name, required when format is attribute.","examples":["src"]}},"type":"object","required":["name","selector"],"title":"ExtractField"},"ExtractRequest":{"properties":{"fields":{"items":{"$ref":"#/components/schemas/ExtractField"},"type":"array","maxItems":10,"minItems":1,"title":"Fields","description":"What to extract from each page."},"page_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array","maxItems":10000},{"type":"null"}],"title":"Page Ids","description":"Only these pages. Without it, pages matching the filters."},"q":{"type":"string","maxLength":200,"title":"Q","description":"Text in the URL or title. With `*` it is a path pattern, e.g. `/blog/*`.","default":""},"filters":{"items":{"type":"string","maxLength":400,"minLength":1},"type":"array","maxItems":10,"title":"Filters","description":"Conditions written as `field:operator:value`, e.g. `path:pattern:/blog/*` or `words:gte:300`.","default":[]},"match":{"type":"string","enum":["all","any"],"title":"Match","description":"Should a page meet all filters or any of them.","default":"all"},"limit":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Limit","description":"Number of pages to return.","default":50},"offset":{"type":"integer","maximum":100000.0,"minimum":0.0,"title":"Offset","description":"Number of pages to skip.","default":0}},"type":"object","required":["fields"],"title":"ExtractRequest"},"ExtractResult":{"properties":{"total":{"type":"integer","title":"Total","description":"Number of selected pages."},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset","description":"Offset of the next request. null at the end."},"pages":{"items":{"$ref":"#/components/schemas/ExtractedPage"},"type":"array","title":"Pages","description":"May be shorter than `limit` when the pages are large."}},"type":"object","required":["total","next_offset","pages"],"title":"ExtractResult"},"ExtractedPage":{"properties":{"id":{"type":"integer","title":"Id","description":"Page number in the crawl."},"url":{"type":"string","title":"Url","description":"Address of the page."},"title":{"type":"string","title":"Title","description":"Content of the title tag."},"status":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status","description":"null when the page could not be fetched."},"has_html":{"type":"boolean","title":"Has Html","description":"false: the HTML of this page was not saved."},"truncated":{"type":"boolean","title":"Truncated","description":"true: the page had more data than the limit allows."},"values":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Values","description":"Field name and all its matches, in page order."}},"type":"object","required":["id","url","title","status","has_html","truncated","values"],"title":"ExtractedPage"},"Header":{"properties":{"name":{"type":"string","title":"Name"},"value":{"type":"string","title":"Value"}},"type":"object","required":["name","value"],"title":"Header"},"Heading":{"properties":{"level":{"type":"integer","title":"Level","description":"1 for h1, 6 for h6."},"text":{"type":"string","title":"Text"}},"type":"object","required":["level","text"],"title":"Heading"},"Image":{"properties":{"src":{"type":"string","title":"Src"},"alt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alt","description":"null: missing attribute, empty string: empty alt."},"lazy":{"type":"boolean","title":"Lazy","description":"Whether the image has loading=lazy."},"width":{"type":"string","title":"Width"},"height":{"type":"string","title":"Height"}},"type":"object","required":["src","alt","lazy","width","height"],"title":"Image"},"Link":{"properties":{"url":{"type":"string","title":"Url"},"text":{"type":"string","title":"Text"},"type":{"type":"string","enum":["internal","external","other"],"title":"Type","description":"other: mailto, tel and similar."},"rel":{"type":"string","title":"Rel","description":"Value of the rel attribute."},"nofollow":{"type":"boolean","title":"Nofollow"}},"type":"object","required":["url","text","type","rel","nofollow"],"title":"Link"},"PageData":{"properties":{"url":{"type":"string","title":"Url","description":"Requested address."},"final_url":{"type":"string","title":"Final Url","description":"Address after all redirects."},"path":{"type":"string","title":"Path","description":"Path of the final address."},"status":{"type":"integer","title":"Status","description":"HTTP status of the page."},"content_type":{"type":"string","title":"Content Type","description":"Content type sent by the server."},"redirects":{"items":{"$ref":"#/components/schemas/Redirect"},"type":"array","title":"Redirects","description":"Redirects in order, with address and status."},"headers":{"items":{"$ref":"#/components/schemas/Header"},"type":"array","title":"Headers","description":"HTTP headers of the page, names in lowercase."},"duration_ms":{"type":"integer","title":"Duration Ms","description":"Fetch time in milliseconds."},"size_bytes":{"type":"integer","title":"Size Bytes","description":"Size of the fetched content in bytes."},"truncated":{"type":"boolean","title":"Truncated","description":"Whether the content was cut at the 10 MB limit."},"lang":{"type":"string","title":"Lang","description":"Language from the lang attribute."},"title":{"type":"string","title":"Title","description":"Content of the title tag."},"meta_description":{"type":"string","title":"Meta Description","description":"Content of the meta description."},"canonical":{"type":"string","title":"Canonical","description":"Canonical address."},"robots":{"$ref":"#/components/schemas/Robots","description":"Meta robots and X-Robots-Tag, with the resulting index and follow."},"word_count":{"type":"integer","title":"Word Count","description":"Number of words in the page content."},"headings":{"items":{"$ref":"#/components/schemas/Heading"},"type":"array","title":"Headings","description":"Headings h1 to h6 in page order."},"links":{"items":{"$ref":"#/components/schemas/Link"},"type":"array","title":"Links","description":"Links: address, text, type, rel and nofollow."},"images":{"items":{"$ref":"#/components/schemas/Image"},"type":"array","title":"Images","description":"Images: src, alt, lazy and dimensions."},"html":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Html","description":"Raw HTML if you ask for include_html, otherwise null."}},"type":"object","required":["url","final_url","path","status","content_type","redirects","headers","duration_ms","size_bytes","truncated","lang","title","meta_description","canonical","robots","word_count","headings","links","images"],"title":"PageData"},"RecentPage":{"properties":{"url":{"type":"string","title":"Url"},"status":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status","description":"null when the page could not be fetched."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error code when the page could not be fetched."}},"type":"object","required":["url","status","error"],"title":"RecentPage"},"Redirect":{"properties":{"url":{"type":"string","title":"Url"},"status":{"type":"integer","title":"Status"}},"type":"object","required":["url","status"],"title":"Redirect"},"RetryRequest":{"properties":{"page_ids":{"items":{"type":"integer"},"type":"array","maxItems":10000,"minItems":1,"title":"Page Ids","description":"Page numbers from the list of pages."}},"type":"object","required":["page_ids"],"title":"RetryRequest"},"Robots":{"properties":{"meta":{"type":"string","title":"Meta","description":"Content of meta robots."},"x_robots_tag":{"type":"string","title":"X Robots Tag","description":"Value of the X-Robots-Tag header."},"index":{"type":"boolean","title":"Index","description":"Whether the page may be indexed."},"follow":{"type":"boolean","title":"Follow","description":"Whether its links may be followed."}},"type":"object","required":["meta","x_robots_tag","index","follow"],"title":"Robots"},"ScrapeRequest":{"properties":{"url":{"type":"string","maxLength":2048,"minLength":1,"title":"Url","description":"Page address. Without a scheme, https:// is added.","examples":["https://example.com"]},"include_html":{"type":"boolean","title":"Include Html","description":"Return raw HTML in the response.","default":false}},"type":"object","required":["url"],"title":"ScrapeRequest"},"ScrapeResult":{"properties":{"url":{"type":"string","title":"Url","description":"Requested address."},"final_url":{"type":"string","title":"Final Url","description":"Address after all redirects."},"path":{"type":"string","title":"Path","description":"Path of the final address."},"status":{"type":"integer","title":"Status","description":"HTTP status of the page."},"content_type":{"type":"string","title":"Content Type","description":"Content type sent by the server."},"redirects":{"items":{"$ref":"#/components/schemas/Redirect"},"type":"array","title":"Redirects","description":"Redirects in order, with address and status."},"headers":{"items":{"$ref":"#/components/schemas/Header"},"type":"array","title":"Headers","description":"HTTP headers of the page, names in lowercase."},"duration_ms":{"type":"integer","title":"Duration Ms","description":"Fetch time in milliseconds."},"size_bytes":{"type":"integer","title":"Size Bytes","description":"Size of the fetched content in bytes."},"truncated":{"type":"boolean","title":"Truncated","description":"Whether the content was cut at the 10 MB limit."},"lang":{"type":"string","title":"Lang","description":"Language from the lang attribute."},"title":{"type":"string","title":"Title","description":"Content of the title tag."},"meta_description":{"type":"string","title":"Meta Description","description":"Content of the meta description."},"canonical":{"type":"string","title":"Canonical","description":"Canonical address."},"robots":{"$ref":"#/components/schemas/Robots","description":"Meta robots and X-Robots-Tag, with the resulting index and follow."},"word_count":{"type":"integer","title":"Word Count","description":"Number of words in the page content."},"headings":{"items":{"$ref":"#/components/schemas/Heading"},"type":"array","title":"Headings","description":"Headings h1 to h6 in page order."},"links":{"items":{"$ref":"#/components/schemas/Link"},"type":"array","title":"Links","description":"Links: address, text, type, rel and nofollow."},"images":{"items":{"$ref":"#/components/schemas/Image"},"type":"array","title":"Images","description":"Images: src, alt, lazy and dimensions."},"html":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Html","description":"Raw HTML if you ask for include_html, otherwise null."},"id":{"type":"string","title":"Id","description":"Result identifier."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Date and time of the scrape."},"saved":{"type":"boolean","title":"Saved","description":"Whether the result was saved in your team."}},"type":"object","required":["url","final_url","path","status","content_type","redirects","headers","duration_ms","size_bytes","truncated","lang","title","meta_description","canonical","robots","word_count","headings","links","images","id","created_at","saved"],"title":"ScrapeResult"},"Tokens":{"properties":{"limit":{"type":"integer","title":"Limit","description":"Tokens per day. One fetched page costs one token."},"used":{"type":"integer","title":"Used","description":"Used today, including tokens reserved by crawls in progress."},"remaining":{"type":"integer","title":"Remaining","description":"Tokens left today."},"resets_at":{"type":"string","format":"date-time","title":"Resets At","description":"When the tokens renew (midnight UTC)."}},"type":"object","required":["limit","used","remaining","resets_at"],"title":"Tokens"}},"securitySchemes":{"HTTPBearer":{"type":"http","description":"API key (ssk_...)","scheme":"bearer"}}}}