{"openapi":"3.1.0","info":{"title":"Search1API","description":"Web search, news, crawling, screenshot, and content extraction APIs for AI agents. Supports pay-per-request via MPP and x402 protocols.","version":"1.0.0","x-guidance":"Search1API provides web search, news aggregation, URL crawling, webpage screenshots, sitemap extraction, trending topics, content extraction, and deep crawling. All paid endpoints accept POST with a JSON body. Use POST /search with a \"query\" field for web search. Use POST /news with a \"query\" field for news. Use POST /crawl with a \"url\" field to crawl a page. Use POST /screenshot with a \"url\" field to render a PNG, JPEG, or WebP image. Use POST /sitemap with a \"url\" field to extract sitemap URLs. Use POST /trending with a \"search_service\" field for trends. Use POST /extract with a \"url\" field for structured content extraction. Use POST /deepcrawl with a \"url\" field for deep multi-page crawling."},"x-discovery":{"ownershipProofs":[]},"servers":[{"url":"https://api.search1api.com"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key"}},"schemas":{"ApiError":{"type":"object","description":"Search1API error. Payment challenges may use RFC 9457 problem detail fields.","properties":{"ok":{"type":"boolean","enum":[false]},"error":{"type":"string"},"message":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}},"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"}},"additionalProperties":true},"SearchParameters":{"type":"object","properties":{"query":{"type":"string","minLength":1},"search_service":{"type":"string","enum":["google","bing","bingcn","duckduckgo","yahoo","youtube","x","reddit","github","arxiv","wechat","bilibili","imdb","wikipedia","","baidu","360","quark"]},"max_results":{"type":"integer","minimum":1,"maximum":50,"default":5},"page":{"type":"integer","minimum":1,"maximum":100,"default":1},"crawl_results":{"type":"integer","minimum":0,"maximum":50,"default":0},"image":{"type":"boolean","default":false},"include_sites":{"type":"array","items":{"type":"string"},"default":[]},"exclude_sites":{"type":"array","items":{"type":"string"},"default":[]},"language":{"type":"string"},"time_range":{"type":"string","enum":["day","week","month","year",""]}},"required":["query"],"additionalProperties":false},"NewsParameters":{"type":"object","properties":{"query":{"type":"string","minLength":1},"search_service":{"type":"string","enum":["google","bing","duckduckgo","yahoo","hackernews","","reuters"]},"max_results":{"type":"integer","minimum":1,"maximum":50,"default":5},"crawl_results":{"type":"integer","minimum":0,"maximum":50,"default":0},"image":{"type":"boolean","default":false},"include_sites":{"type":"array","items":{"type":"string"},"default":[]},"exclude_sites":{"type":"array","items":{"type":"string"},"default":[]},"language":{"type":"string"},"time_range":{"type":"string","enum":["day","week","month","year",""]}},"required":["query"],"additionalProperties":false},"CrawlRequest":{"type":"object","properties":{"url":{"type":"string","format":"uri","minLength":1},"enableFallback":{"type":"boolean","default":true}},"required":["url"],"additionalProperties":false},"SitemapRequest":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"type":{"type":"string","enum":["sitemap","all"]}},"required":["url"],"additionalProperties":false},"TrendingRequest":{"type":"object","properties":{"search_service":{"type":"string","minLength":1},"max_results":{"type":"integer","minimum":1}},"required":["search_service"],"additionalProperties":false},"ExtractRequest":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"prompt":{"type":"string"},"response_format":{"type":"object","additionalProperties":{}}},"required":["url"],"additionalProperties":false},"DeepcrawlRequest":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"type":{"type":"string","enum":["sitemap","all"]}},"required":["url"],"additionalProperties":false},"SearchResult":{"type":"object","required":["title","link","snippet"],"properties":{"title":{"type":"string"},"link":{"type":"string","format":"uri"},"snippet":{"type":"string"},"content":{"type":"string"}},"additionalProperties":true},"SearchResponse":{"type":"object","required":["searchParameters","results"],"properties":{"searchParameters":{"$ref":"#/components/schemas/SearchParameters"},"results":{"type":"array","items":{"$ref":"#/components/schemas/SearchResult"}},"images":{"type":"array","items":{"type":"string","format":"uri"}}}},"SearchBatchResponse":{"type":"object","required":["results","summary"],"properties":{"results":{"type":"array","items":{"type":"object","required":["success","cost"],"properties":{"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/SearchResponse"},"error":{"type":"object","properties":{"message":{"type":"string"},"statusCode":{"type":"integer"}}},"cost":{"type":"integer","minimum":0}}}},"summary":{"type":"object","required":["total","successful","failed","totalCost"],"properties":{"total":{"type":"integer","minimum":0},"successful":{"type":"integer","minimum":0},"failed":{"type":"integer","minimum":0},"totalCost":{"type":"integer","minimum":0}}}}},"NewsResponse":{"type":"object","required":["searchParameters","results"],"properties":{"searchParameters":{"$ref":"#/components/schemas/NewsParameters"},"results":{"type":"array","items":{"$ref":"#/components/schemas/SearchResult"}},"images":{"type":"array","items":{"type":"string","format":"uri"}}}},"NewsBatchResponse":{"type":"object","required":["results","summary"],"properties":{"results":{"type":"array","items":{"type":"object","required":["success","cost"],"properties":{"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/NewsResponse"},"error":{"type":"object","properties":{"message":{"type":"string"},"statusCode":{"type":"integer"}}},"cost":{"type":"integer","minimum":0}}}},"summary":{"type":"object","required":["total","successful","failed","totalCost"],"properties":{"total":{"type":"integer","minimum":0},"successful":{"type":"integer","minimum":0},"failed":{"type":"integer","minimum":0},"totalCost":{"type":"integer","minimum":0}}}}},"CrawlResult":{"type":"object","required":["title","link","content"],"properties":{"title":{"type":"string"},"link":{"type":"string","format":"uri"},"content":{"type":"string"},"metadata":{"type":"object","additionalProperties":true}},"additionalProperties":true},"CrawlResponse":{"type":"object","required":["crawlParameters","results"],"properties":{"crawlParameters":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"}}},"results":{"$ref":"#/components/schemas/CrawlResult"}}},"SitemapResponse":{"type":"object","required":["links"],"properties":{"links":{"type":"array","items":{"type":"string","format":"uri"}}}},"TrendingResult":{"type":"object","required":["title","url"],"properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"},"description":{"type":["string","null"]}}},"TrendingResponse":{"type":"object","required":["trendingParameters","results"],"properties":{"trendingParameters":{"$ref":"#/components/schemas/TrendingRequest"},"results":{"type":"array","items":{"$ref":"#/components/schemas/TrendingResult"}}}},"ExtractResponse":{"type":"object","required":["success","extractParameters","results"],"properties":{"success":{"type":"boolean","enum":[true]},"extractParameters":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"}}},"results":{}}},"DeepcrawlAcceptedResponse":{"type":"object","required":["taskId","status"],"properties":{"taskId":{"type":"string"},"status":{"type":"string","enum":["queued"]}}},"DeepcrawlStatusResponse":{"type":"object","required":["taskId"],"properties":{"taskId":{"type":"string"},"status":{"type":"string","enum":["queued","waiting","processing","completed","failed","not_found"]},"success":{"type":"boolean"},"message":{"type":"string"},"error":{"type":["string","null"]},"r2Key":{"type":"string"},"zipUrl":{"type":["string","null"],"format":"uri"}},"additionalProperties":true},"HealthResponse":{"type":"object","required":["status"],"properties":{"status":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}},"UsageResponse":{"type":"object","required":["usage","credential_type"],"properties":{"usage":{"type":"integer","minimum":0},"user_id":{"type":["string","null"]},"credential_type":{"type":"string","enum":["api_key","oauth"]},"client_id":{"type":["string","null"]}}}}},"paths":{"/screenshot":{"post":{"operationId":"screenshot","summary":"Render a web page as a PNG, JPEG, or WebP image","description":"Render a public webpage as a PNG, JPEG, or WebP image. Use it when appearance is the point — layout checks, visual previews, or content that does not survive text extraction — and control the viewport, when the page counts as ready, and whether to capture the full document or a single element by CSS selector. When you want the page's text instead, call POST /crawl. Costs 2 credits per request.","tags":["Screenshot"],"x-codeSamples":[{"id":"js","lang":"ts","label":"TypeScript SDK","source":"import { writeFile } from 'node:fs/promises';\nimport { Search1API } from '@search1api/client';\n\nconst client = new Search1API();\nconst screenshot = await client.screenshot('https://example.com', {\n  format: 'png',\n  fullPage: true,\n});\n\nawait writeFile('screenshot.png', screenshot.data);"},{"id":"python","lang":"python","label":"Python SDK","source":"from pathlib import Path\nfrom search1api import Search1API\n\nclient = Search1API()\nscreenshot = client.screenshot(\n    \"https://example.com\",\n    format=\"png\",\n    full_page=True,\n)\n\nPath(\"screenshot.png\").write_bytes(screenshot[\"data\"])"}],"responses":{"200":{"description":"Successful response","content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Payment Required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Bad Gateway","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Gateway Timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"bearerAuth":[]}],"x-payment-info":{"protocols":["mpp"],"pricingMode":"fixed","price":"0.006"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","maxLength":4096},"format":{"type":"string","enum":["png","jpeg","webp"],"default":"png"},"full_page":{"type":"boolean","default":false},"viewport":{"type":"object","properties":{"width":{"type":"integer","minimum":320,"maximum":2560,"default":1440},"height":{"type":"integer","minimum":200,"maximum":1440,"default":900},"device_scale_factor":{"type":"number","minimum":1,"maximum":2,"default":1}},"additionalProperties":false,"default":{"width":1440,"height":900,"device_scale_factor":1}},"wait_until":{"type":"string","enum":["domcontentloaded","load","networkidle"],"default":"load"},"wait_for_selector":{"type":"string","minLength":1,"maxLength":500},"selector":{"type":"string","minLength":1,"maxLength":500},"delay_ms":{"type":"integer","minimum":0,"maximum":5000,"default":0},"timeout_ms":{"type":"integer","minimum":1000,"maximum":30000,"default":20000},"quality":{"type":"integer","minimum":1,"maximum":100},"omit_background":{"type":"boolean","default":false},"color_scheme":{"type":"string","enum":["light","dark"],"default":"light"},"animations":{"type":"string","enum":["disabled","allow"],"default":"disabled"}},"required":["url"],"additionalProperties":false},"examples":{"fullPage":{"summary":"Full-page PNG","description":"Capture the complete document after the load event and a short stabilization delay.","value":{"url":"https://s1.dev","format":"png","full_page":true,"wait_until":"load","delay_ms":1000,"timeout_ms":30000}},"element":{"summary":"Page element as WebP","description":"Wait for one visible element and return only that element as a compressed WebP image.","value":{"url":"https://example.com","format":"webp","selector":"h1","wait_for_selector":"h1","quality":85}},"darkViewport":{"summary":"Dark-mode viewport","description":"Capture a high-density 1280 × 720 viewport with dark color-scheme emulation.","value":{"url":"https://s1.dev","format":"jpeg","viewport":{"width":1280,"height":720,"device_scale_factor":2},"color_scheme":"dark","quality":85}}}}}}}},"/search":{"post":{"operationId":"search","summary":"Search the web using multiple search engines","description":"Search the live public web when the answer depends on current information, sources, or research a model's training data cannot cover. Returns ranked results with id, title, URL, and snippet across 13+ engines, with optional images. Set `crawl_results` to pull the top N result pages in the same call — each crawled page is billed as an additional crawl — or pass a result URL to POST /crawl separately. Costs 1 credit per request.","tags":["Search"],"x-codeSamples":[{"id":"js","lang":"ts","label":"TypeScript SDK","source":"import { Search1API } from '@search1api/client';\n\nconst client = new Search1API();\nconst response = await client.search('latest AI agent frameworks', {\n  maxResults: 10,\n});\n\nconsole.log(response.results);"},{"id":"python","lang":"python","label":"Python SDK","source":"from search1api import Search1API\n\nclient = Search1API()\nresponse = client.search(\n    \"latest AI agent frameworks\",\n    max_results=10,\n)\n\nprint(response[\"results\"])"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/SearchResponse"},{"$ref":"#/components/schemas/SearchBatchResponse"}]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Payment Required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Bad Gateway","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"bearerAuth":[]}],"x-payment-info":{"protocols":["mpp"],"pricingMode":"fixed","price":"0.003"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"query":{"type":"string","minLength":1},"search_service":{"type":"string","enum":["google","bing","bingcn","duckduckgo","yahoo","youtube","x","reddit","github","arxiv","wechat","bilibili","imdb","wikipedia","","baidu","360","quark"]},"max_results":{"type":"integer","minimum":1,"maximum":50,"default":5},"page":{"type":"integer","minimum":1,"maximum":100,"default":1},"crawl_results":{"type":"integer","minimum":0,"maximum":50,"default":0},"image":{"type":"boolean","default":false},"include_sites":{"type":"array","items":{"type":"string"},"default":[]},"exclude_sites":{"type":"array","items":{"type":"string"},"default":[]},"language":{"type":"string"},"time_range":{"type":"string","enum":["day","week","month","year",""]}},"required":["query"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"query":{"type":"string","minLength":1},"search_service":{"type":"string","enum":["google","bing","bingcn","duckduckgo","yahoo","youtube","x","reddit","github","arxiv","wechat","bilibili","imdb","wikipedia","","baidu","360","quark"]},"max_results":{"type":"integer","minimum":1,"maximum":50,"default":5},"page":{"type":"integer","minimum":1,"maximum":100,"default":1},"crawl_results":{"type":"integer","minimum":0,"maximum":50,"default":0},"image":{"type":"boolean","default":false},"include_sites":{"type":"array","items":{"type":"string"},"default":[]},"exclude_sites":{"type":"array","items":{"type":"string"},"default":[]},"language":{"type":"string"},"time_range":{"type":"string","enum":["day","week","month","year",""]}},"required":["query"],"additionalProperties":false},"minItems":1}]}}}}}},"/news":{"post":{"operationId":"news","summary":"Search news articles across multiple sources","description":"Search recent news when the question is about events, announcements, or coverage rather than reference material. Returns articles from verified publishers with title, URL, snippet, and optional full page content, filterable by site, language, and time range. For questions that are not time-sensitive, prefer POST /search. Costs 1 credit per request.","tags":["Search"],"x-codeSamples":[{"id":"js","lang":"ts","label":"TypeScript SDK","source":"import { Search1API } from '@search1api/client';\n\nconst client = new Search1API();\nconst response = await client.news('latest AI industry news', {\n  maxResults: 10,\n});\n\nconsole.log(response.results);"},{"id":"python","lang":"python","label":"Python SDK","source":"from search1api import Search1API\n\nclient = Search1API()\nresponse = client.news(\n    \"latest AI industry news\",\n    max_results=10,\n)\n\nprint(response[\"results\"])"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/NewsResponse"},{"$ref":"#/components/schemas/NewsBatchResponse"}]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Payment Required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Bad Gateway","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"bearerAuth":[]}],"x-payment-info":{"protocols":["mpp"],"pricingMode":"fixed","price":"0.003"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"query":{"type":"string","minLength":1},"search_service":{"type":"string","enum":["google","bing","duckduckgo","yahoo","hackernews","","reuters"]},"max_results":{"type":"integer","minimum":1,"maximum":50,"default":5},"crawl_results":{"type":"integer","minimum":0,"maximum":50,"default":0},"image":{"type":"boolean","default":false},"include_sites":{"type":"array","items":{"type":"string"},"default":[]},"exclude_sites":{"type":"array","items":{"type":"string"},"default":[]},"language":{"type":"string"},"time_range":{"type":"string","enum":["day","week","month","year",""]}},"required":["query"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"query":{"type":"string","minLength":1},"search_service":{"type":"string","enum":["google","bing","duckduckgo","yahoo","hackernews","","reuters"]},"max_results":{"type":"integer","minimum":1,"maximum":50,"default":5},"crawl_results":{"type":"integer","minimum":0,"maximum":50,"default":0},"image":{"type":"boolean","default":false},"include_sites":{"type":"array","items":{"type":"string"},"default":[]},"exclude_sites":{"type":"array","items":{"type":"string"},"default":[]},"language":{"type":"string"},"time_range":{"type":"string","enum":["day","week","month","year",""]}},"required":["query"],"additionalProperties":false},"minItems":1}]}}}}}},"/crawl":{"post":{"operationId":"crawl","summary":"Crawl a URL and extract its content","description":"Fetch one public URL and return its readable title and body as clean text, with navigation, boilerplate, and scripts stripped. Use it on a URL the user supplied or one returned by POST /search. To ingest a whole site rather than a single page, use POST /deepcrawl. Costs 1 credit per request.","tags":["Crawl"],"x-codeSamples":[{"id":"js","lang":"ts","label":"TypeScript SDK","source":"import { Search1API } from '@search1api/client';\n\nconst client = new Search1API();\nconst response = await client.crawl('https://example.com');\n\nconsole.log(response);"},{"id":"python","lang":"python","label":"Python SDK","source":"from search1api import Search1API\n\nclient = Search1API()\nresponse = client.crawl(\"https://example.com\")\n\nprint(response)"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/CrawlResponse"},{"type":"array","items":{"$ref":"#/components/schemas/CrawlResponse"}}]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Payment Required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"410":{"description":"Gone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Bad Gateway","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"bearerAuth":[]}],"x-payment-info":{"protocols":["mpp"],"pricingMode":"fixed","price":"0.003"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"url":{"type":"string","format":"uri","minLength":1},"enableFallback":{"type":"boolean","default":true}},"required":["url"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","minLength":1},"enableFallback":{"type":"boolean","default":true}},"required":["url"],"additionalProperties":false},"minItems":1}]}}}}}},"/sitemap":{"post":{"operationId":"sitemap","summary":"Extract sitemap URLs from a website","description":"Discover the public URLs of a site when you need to know which pages exist before fetching any of them — scoping a crawl, auditing coverage, or locating a section. With the default `type: \"sitemap\"` this reads the site's own sitemap: `Sitemap:` directives in robots.txt first, then the conventional paths, following sitemap index files and gzipped sitemaps, and returns the URLs it declares for the requested host. A site that publishes no sitemap falls back to the links found on the given page. Use `type: \"all\"` to skip the sitemap and get every link on that one page instead, including links to other hosts. Neither mode fetches page content. Costs 1 credit per request.","tags":["Crawl"],"x-codeSamples":[{"id":"js","lang":"ts","label":"TypeScript SDK","source":"import { Search1API } from '@search1api/client';\n\nconst client = new Search1API();\nconst response = await client.sitemap('https://example.com');\n\nconsole.log(response);"},{"id":"python","lang":"python","label":"Python SDK","source":"from search1api import Search1API\n\nclient = Search1API()\nresponse = client.sitemap(\"https://example.com\")\n\nprint(response)"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SitemapResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Payment Required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Bad Gateway","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"bearerAuth":[]}],"x-payment-info":{"protocols":["mpp"],"pricingMode":"fixed","price":"0.003"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"type":{"type":"string","enum":["sitemap","all"]}},"required":["url"],"additionalProperties":false}}}}}},"/trending":{"post":{"operationId":"trending","summary":"Get trending topics from various platforms","description":"List what is currently popular on a supported platform, such as GitHub repositories or Hacker News stories, when the user asks what is trending or new right now. This reads a platform's own live ranking rather than performing a query — for topic searches use POST /search. Costs 1 credit per request.","tags":["Search"],"x-codeSamples":[{"id":"js","lang":"ts","label":"TypeScript SDK","source":"import { Search1API } from '@search1api/client';\n\nconst client = new Search1API();\nconst response = await client.trending('github', {\n  maxResults: 10,\n});\n\nconsole.log(response);"},{"id":"python","lang":"python","label":"Python SDK","source":"from search1api import Search1API\n\nclient = Search1API()\nresponse = client.trending(\"github\", max_results=10)\n\nprint(response)"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrendingResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Payment Required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Bad Gateway","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"bearerAuth":[]}],"x-payment-info":{"protocols":["mpp"],"pricingMode":"fixed","price":"0.003"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"search_service":{"type":"string","minLength":1},"max_results":{"type":"integer","minimum":1}},"required":["search_service"],"additionalProperties":false}}}}}},"/extract":{"post":{"operationId":"extract","summary":"Extract structured content from a URL","description":"Pull structured data out of a single webpage using a natural-language prompt and a JSON schema you supply. Use it when you need specific fields — prices, specifications, contact details — rather than the whole document; when you want the full text, use POST /crawl. Costs 10 credits per request.","tags":["Crawl"],"x-codeSamples":[{"id":"js","lang":"ts","label":"TypeScript SDK","source":"import { Search1API } from '@search1api/client';\n\nconst client = new Search1API();\nconst response = await client.extract('https://example.com', {\n  prompt: 'Extract the page title and description.',\n});\n\nconsole.log(response);"},{"id":"python","lang":"python","label":"Python SDK","source":"from search1api import Search1API\n\nclient = Search1API()\nresponse = client.extract(\n    \"https://example.com\",\n    prompt=\"Extract the page title and description.\",\n)\n\nprint(response)"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Payment Required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Bad Gateway","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"bearerAuth":[]}],"x-payment-info":{"protocols":["mpp"],"pricingMode":"fixed","price":"0.03"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"prompt":{"type":"string"},"response_format":{"type":"object","additionalProperties":{}}},"required":["url"],"additionalProperties":false}}}}}},"/deepcrawl":{"post":{"operationId":"deepcrawl","summary":"Deep crawl a website across multiple pages","description":"Start an asynchronous crawl of an entire site and package the pages as documents. Use it for whole-site ingestion; a single page is POST /crawl. The call returns a task id immediately rather than the result — poll GET /deepcrawl/status/{taskId} until the task reports completion. Costs 20 credits per request.","tags":["Crawl"],"x-codeSamples":[{"id":"js","lang":"ts","label":"TypeScript SDK","source":"import { Search1API } from '@search1api/client';\n\nconst client = new Search1API();\nconst task = await client.startDeepcrawl('https://example.com', {\n  type: 'all',\n});\n\nconsole.log(task.taskId);"},{"id":"python","lang":"python","label":"Python SDK","source":"from search1api import Search1API\n\nclient = Search1API()\ntask = client.start_deepcrawl(\"https://example.com\", type=\"all\")\n\nprint(task[\"taskId\"])"}],"responses":{"202":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepcrawlAcceptedResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Payment Required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Bad Gateway","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"bearerAuth":[]}],"x-payment-info":{"protocols":["mpp"],"pricingMode":"fixed","price":"0.06"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"type":{"type":"string","enum":["sitemap","all"]}},"required":["url"],"additionalProperties":false}}}}}},"/deepcrawl/status/{taskId}":{"get":{"operationId":"deepcrawlStatus","summary":"Check deepcrawl task status","description":"Poll a deepcrawl task started by POST /deepcrawl. Returns the task's current state and, once it finishes, where to retrieve the packaged result. Safe to call repeatedly. Free to call.","tags":["Crawl"],"x-codeSamples":[{"id":"js","lang":"ts","label":"TypeScript SDK","source":"import { Search1API } from '@search1api/client';\n\nconst client = new Search1API();\nconst status = await client.getDeepcrawlStatus('task_id');\n\nconsole.log(status);"},{"id":"python","lang":"python","label":"Python SDK","source":"from search1api import Search1API\n\nclient = Search1API()\nstatus = client.get_deepcrawl_status(\"task_id\")\n\nprint(status)"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepcrawlStatusResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Bad Gateway","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"taskId","required":true,"schema":{"type":"string","minLength":1}}]}},"/health":{"get":{"operationId":"health","summary":"Health check","description":"Report whether the API is serving traffic. Takes no credentials, so use it for uptime and readiness checks — it will not tell you whether an API key is valid; call GET /usage for that. Free to call.","tags":["System"],"x-codeSamples":[{"id":"js","lang":"ts","label":"TypeScript SDK","source":"import { Search1API } from '@search1api/client';\n\nconst client = new Search1API();\nconst health = await client.health();\n\nconsole.log(health);"},{"id":"python","lang":"python","label":"Python SDK","source":"from search1api import Search1API\n\nclient = Search1API()\nhealth = client.health()\n\nprint(health)"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/usage":{"get":{"operationId":"usage","summary":"Get API key usage statistics","description":"Return the remaining credit balance for the authenticated account. Use it to check headroom before starting an expensive job such as a deepcrawl, or to confirm an API key works. Free to call.","tags":["Account"],"x-codeSamples":[{"id":"js","lang":"ts","label":"TypeScript SDK","source":"import { Search1API } from '@search1api/client';\n\nconst client = new Search1API();\nconst usage = await client.usage('month');\n\nconsole.log(usage);"},{"id":"python","lang":"python","label":"Python SDK","source":"from search1api import Search1API\n\nclient = Search1API()\nusage = client.usage(\"month\")\n\nprint(usage)"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"period","required":false,"schema":{"type":"string","enum":["day","week","month","year"]}}]}}}}