openapi: 3.2.0 info: title: 2s — the (most) everything Search API version: '1' summary: The (most) everything API. description: 'The (most) everything API for AI agents: 575+ pay-per-call endpoints on one origin.' contact: name: 2s url: https://2s.io email: alley@2s.io x-logo: url: https://2s.io/icon-512.png altText: 2s x-guidance: 'Pay-per-call REST API for AI agents — hundreds of endpoints returning ground-truth data (US public records, company & legal identifiers, finance/SEC, crypto/web3, security & CVEs, medical codes, weather & geocoding, agriculture, energy, maritime, music, and more). Every endpoint is paid per call in USDC via x402 (Base or Solana) — no API key, no signup. Call any endpoint with no auth to get a 402 PaymentRequirements envelope, sign it (EIP-3009 on Base, partial SPL transfer on Solana), and retry with the PAYMENT-SIGNATURE header. Add ?trial=1 for one free real call per endpoint per hour to test before paying. To discover the right endpoint: GET https://2s.io/api/directory for the full catalog, or GET https://2s.io/api/search/endpoints?q= for a ranked match. Per-call price is on each operation as x-payment-info (from $0.001). Batch up to 50 calls behind one payment via POST https://2s.io/api/batch/run.' servers: - url: https://2s.io tags: - name: Search paths: /api/search/ai: get: tags: - Search summary: AI web search optimized for agents description: AI web search optimized for agents. Returns ranked results with the relevant extracted content of each page (not just a link + blurb), plus a relevance score. topic=news for recent reporting. Distinct from search.web (raw SERP) — this returns clean, LLM-ready page content per result. operationId: search_ai deprecated: false security: - x402Payment: [] responses: '200': description: 'Normalized: items = ranked results with extracted content.' content: application/json: schema: type: object required: - data - meta properties: data: type: object properties: ok: type: boolean enum: - true items: type: array items: type: object properties: title: type: string nullable: true url: type: string nullable: true content: type: string nullable: true score: type: number nullable: true required: - title - url - content - score additionalProperties: false total: type: integer nullable: true description: Total matching rows upstream; null when unknown. source: $ref: '#/components/schemas/Source' required: - ok - items - total - source additionalProperties: false meta: $ref: '#/components/schemas/CallMeta' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/PaymentRequired' '405': $ref: '#/components/responses/MethodNotAllowed' '500': $ref: '#/components/responses/ServerError' '502': $ref: '#/components/responses/UpstreamError' x-2s-id: search.ai x-2s-version: null x-2s-price: usd: 0.045 x-2s-accepts: - x402 x-2s-response-shape: normalized x-payment-info: price: mode: fixed currency: USD amount: '0.045000' protocols: - x402: {} parameters: - name: q in: query required: true description: Search query. schema: type: string minLength: 2 maxLength: 400 - name: maxResults in: query required: false description: Max results. schema: type: integer minimum: 1 maximum: 10 - name: topic in: query required: false description: Topic. schema: type: string enum: - general - news - $ref: '#/components/parameters/TrialMode' /api/search/crawl: post: tags: - Search summary: Crawl a site and return clean page content description: Crawl a site and return clean page content. POST { url, limit?, maxDepth?, instructions? }. Follows links from the start URL (up to 10 pages, depth ≤2) and returns each page's extracted content. Optional natural-language instructions steer which pages to follow (e.g. "only pricing and docs pages"). For ingesting a small site/section in one call. operationId: search_crawl deprecated: false security: - x402Payment: [] responses: '200': description: 'Normalized: items = crawled pages with content; meta.baseUrl = start URL.' content: application/json: schema: type: object required: - data - meta properties: data: type: object properties: ok: type: boolean enum: - true items: type: array items: type: object properties: url: type: string nullable: true content: type: string nullable: true required: - url - content additionalProperties: false total: type: integer nullable: true description: Total matching rows upstream; null when unknown. source: $ref: '#/components/schemas/Source' meta: type: object properties: baseUrl: type: string required: - baseUrl additionalProperties: false required: - ok - items - total - source additionalProperties: false meta: $ref: '#/components/schemas/CallMeta' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/PaymentRequired' '405': $ref: '#/components/responses/MethodNotAllowed' '500': $ref: '#/components/responses/ServerError' '502': $ref: '#/components/responses/UpstreamError' x-2s-id: search.crawl x-2s-version: null x-2s-price: usd: 0.12 x-2s-accepts: - x402 x-2s-response-shape: normalized x-payment-info: price: mode: fixed currency: USD amount: '0.120000' protocols: - x402: {} requestBody: required: true content: application/json: schema: type: object properties: url: type: string format: uri maxLength: 2048 description: Start URL to crawl. limit: type: integer minimum: 1 maximum: 10 description: Max pages (≤10). maxDepth: type: integer minimum: 1 maximum: 2 description: Max depth. instructions: type: string maxLength: 300 description: Natural-language steering for which pages to follow. required: - url additionalProperties: false parameters: - $ref: '#/components/parameters/TrialMode' /api/search/endpoints: get: tags: - Search summary: Find the right 2s endpoint for a task using natural language description: Find the right 2s endpoint for a task using natural language. Pass q (e.g. 'check if a domain can be spoofed', 'is this CVE being exploited', 'screen a company for sanctions', 'decode a VIN') and get back the catalog's most relevant endpoints, ranked, each with its id, API path, method, group, description, and price. Deterministic keyword + synonym matching over the live endpoint registry (no LLM, no external calls) — a self-routing index so an agent (or its planner) can discover which paid call answers a question instead of reading the whole 290+ endpoint catalog. Returns the path you then call directly. operationId: search_endpoints deprecated: false security: - x402Payment: [] responses: '200': description: 'Normalized envelope: items = ranked matching endpoints (call the .path directly); meta.total = total matches.' content: application/json: schema: type: object required: - data - meta properties: data: type: object properties: ok: type: boolean enum: - true items: type: array items: type: object properties: id: type: string path: type: string method: type: string group: type: string name: type: string description: type: string priceUsd: type: number score: type: number required: - id - path - method - group - name - description - priceUsd - score additionalProperties: false total: type: integer nullable: true description: Total matching rows upstream; null when unknown. source: $ref: '#/components/schemas/Source' meta: type: object properties: query: type: string total: type: integer required: - query - total additionalProperties: false required: - ok - items - total - source additionalProperties: false meta: $ref: '#/components/schemas/CallMeta' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/PaymentRequired' '405': $ref: '#/components/responses/MethodNotAllowed' '500': $ref: '#/components/responses/ServerError' '502': $ref: '#/components/responses/UpstreamError' x-2s-id: search.endpoints x-2s-version: null x-2s-price: usd: 0.0025 x-2s-accepts: - x402 x-2s-response-shape: normalized x-payment-info: price: mode: fixed currency: USD amount: '0.002500' protocols: - x402: {} parameters: - name: q in: query required: true description: Free-text search query. schema: type: string minLength: 2 maxLength: 200 - name: limit in: query required: false description: Maximum number of results to return. schema: type: integer minimum: 1 maximum: 50 - $ref: '#/components/parameters/TrialMode' /api/search/extract: post: tags: - Search summary: Extract clean, LLM-ready content from up to 5 URLs in one call description: Extract clean, LLM-ready content from up to 5 URLs in one call. POST { urls[], depth? }. Returns the main text content of each page (JS-rendered, boilerplate stripped) plus a list of any URLs that failed. For feeding web pages to an agent without running your own headless browser. operationId: search_extract deprecated: false security: - x402Payment: [] responses: '200': description: 'Normalized: items = extracted pages; meta.failed = URLs that could not be extracted.' content: application/json: schema: type: object required: - data - meta properties: data: type: object properties: ok: type: boolean enum: - true items: type: array items: type: object properties: url: type: string nullable: true content: type: string nullable: true required: - url - content additionalProperties: false total: type: integer nullable: true description: Total matching rows upstream; null when unknown. source: $ref: '#/components/schemas/Source' meta: type: object properties: failed: type: array items: {} required: - failed additionalProperties: false required: - ok - items - total - source additionalProperties: false meta: $ref: '#/components/schemas/CallMeta' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/PaymentRequired' '405': $ref: '#/components/responses/MethodNotAllowed' '500': $ref: '#/components/responses/ServerError' '502': $ref: '#/components/responses/UpstreamError' x-2s-id: search.extract x-2s-version: null x-2s-price: usd: 0.045 x-2s-accepts: - x402 x-2s-response-shape: normalized x-payment-info: price: mode: fixed currency: USD amount: '0.045000' protocols: - x402: {} requestBody: required: true content: application/json: schema: type: object properties: urls: type: array items: type: string format: uri maxLength: 2048 minItems: 1 maxItems: 5 description: 1-5 URLs to extract. depth: type: string enum: - basic - advanced description: Depth. required: - urls additionalProperties: false parameters: - $ref: '#/components/parameters/TrialMode' /api/search/web: get: tags: - Search summary: Live web search. Returns ranked results with title, URL description: Live web search. Returns ranked results with title, URL, snippet description, site name, and page age — fresh information past any model training cutoff. Supports count (1-20), offset for paging, country (2-letter, e.g. US), freshness (pd=past day, pw=past week, pm=past month, py=past year, or a YYYY-MM-DDtoYYYY-MM-DD range), and safesearch (off/moderate/strict). Use for current events, fact verification, finding documentation, and research. Independent search index. For news-specific results with sources and timestamps see /api/news/search. operationId: search_web deprecated: false security: - x402Payment: [] responses: '200': description: 'Normalized envelope: items = ranked live web results (title, url, snippet, site, age); total = null (Brave reports no count); meta.query echoes the search, meta.moreAvailable signals another offset page.' content: application/json: schema: type: object required: - data - meta properties: data: type: object properties: ok: type: boolean enum: - true items: type: array items: type: object properties: title: type: string url: type: string description: type: string nullable: true siteName: type: string nullable: true age: type: string nullable: true description: Relative page age when known, e.g. "2 days ago". language: type: string nullable: true required: - title - url - description - siteName - age - language additionalProperties: false total: type: integer nullable: true description: Total matching rows upstream; null when unknown. source: $ref: '#/components/schemas/Source' meta: type: object properties: query: type: string moreAvailable: type: boolean description: True when another offset page exists. required: - query - moreAvailable additionalProperties: false required: - ok - items - total - source additionalProperties: false meta: $ref: '#/components/schemas/CallMeta' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/PaymentRequired' '405': $ref: '#/components/responses/MethodNotAllowed' '500': $ref: '#/components/responses/ServerError' '502': $ref: '#/components/responses/UpstreamError' x-2s-id: search.web x-2s-version: null x-2s-price: usd: 0.0225 x-2s-accepts: - x402 x-2s-response-shape: normalized x-payment-info: price: mode: fixed currency: USD amount: '0.022500' protocols: - x402: {} parameters: - name: q in: query required: true description: Search query. schema: type: string minLength: 1 maxLength: 400 - name: count in: query required: false description: Count. schema: type: integer minimum: 1 maximum: 20 default: 10 - name: offset in: query required: false description: Number of results to skip before returning (pagination offset). schema: type: integer minimum: 0 maximum: 9 default: 0 - name: country in: query required: false description: Country name or ISO country code. schema: type: string pattern: ^[a-zA-Z]{2}$ - name: freshness in: query required: false description: Freshness. schema: type: string pattern: ^(pd|pw|pm|py|\d{4}-\d{2}-\d{2}to\d{4}-\d{2}-\d{2})$ - name: safesearch in: query required: false description: Safesearch. schema: type: string enum: - 'off' - moderate - strict - $ref: '#/components/parameters/TrialMode' components: schemas: Source: type: object description: 'Provenance of the data: upstream provider, source URL, and license.' properties: provider: type: string description: Upstream data provider. url: type: string description: Source URL or documentation link. license: type: string description: License / usage terms for the data. CallMeta: type: object description: Per-call meta envelope — endpoint id, cost, caller kind, settlement details. X402PaymentRequiredV2: type: object description: x402 v2 PaymentRequired envelope. Pick any entry from accepts[], sign for that rail, retry with the PAYMENT-SIGNATURE header. required: - x402Version - accepts properties: x402Version: type: integer const: 2 error: type: string description: Human-readable reason payment is required. resource: type: string description: The resource URL being purchased. accepts: type: array description: Payment requirement options, one per supported network (Base USDC, Solana USDC). items: type: object required: - scheme - network - amount - asset - payTo - maxTimeoutSeconds properties: scheme: type: string enum: - exact network: type: string description: CAIP-2 network id, e.g. "eip155:8453" (Base) or "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp". amount: type: string description: Price in atomic asset units (USDC has 6 decimals). asset: type: string description: Asset contract address / mint. payTo: type: string description: Treasury address to pay. maxTimeoutSeconds: type: integer extra: type: object description: 'Rail-specific extras (EVM: EIP-712 domain name/version; Solana: feePayer).' additionalProperties: true extensions: type: object description: Optional discovery metadata (e.g. bazaar input/output schemas). additionalProperties: true responses: PaymentRequired: description: Payment required. Body contains the x402 PaymentRequirements envelope with a multi-network accepts array; the per-call price is in accepts[].amount (and on the operation as x-2s-price). Sign for whichever rail you hold USDC on (EIP-3009 for Base, partial SPL transfer for Solana) and retry with the PAYMENT-SIGNATURE header (X-PAYMENT also accepted for v1 clients). content: application/json: schema: $ref: '#/components/schemas/X402PaymentRequiredV2' UpstreamError: description: Upstream provider error. MethodNotAllowed: description: Method not allowed — see `Allow` header for the supported method. ServerError: description: Internal server error. BadRequest: description: Bad request — invalid parameters. parameters: TrialMode: name: trial in: query required: false description: 'Try before you buy. Set to 1 for one free real call per endpoint per hour — no wallet or payment needed — to verify the endpoint before paying. Equivalent to sending the "X-2s-Trial: 1" request header. Works on every endpoint.' schema: type: integer enum: - 1 securitySchemes: x402Payment: type: apiKey in: header name: PAYMENT-SIGNATURE description: 'x402 protocol v2: base64-encoded PaymentPayload. Call any paid endpoint without auth to receive a 402 with a multi-network PaymentRequirements envelope. Sign for either rail: EIP-3009 transferWithAuthorization (Base USDC) OR a partial SPL token transfer (Solana USDC). Retry with PAYMENT-SIGNATURE header. X-PAYMENT is also accepted for v1 buyer clients. See https://x402.org.'