POST /v1/data/web/search

Changed on

Public Data API facade for web search. Supports normal API-key billing and accountless x402 quotes when called without Authorization or x-api-key and with x-x402: true.

Request

  • Base URL
    https://api.nano-gpt.com/api
  • URL
    https://api.nano-gpt.com/api/v1/data/web/search
  • Auth
    • API key in header x-api-key
    • or HTTP bearer
    • or none

Headers

x-x402'true'

Set to true on unauthenticated accountless x402 quote requests. Without this header, unauthenticated requests return 401 missing_api_key.

Request body

querystring

The query to execute. Required for search and Sofya research; omitted for Sofya fetch and extract.

provider'linkup' | 'tavily' | 'exa' | 'kagi' | 'perplexity' | 'valyu' | 'brave' | 'sofya' | 'firecrawl'

Search provider. Defaults to 'linkup'. 'openai-native' is not supported on /api/web.

operation'search' | 'fetch' | 'extract' | 'research'

Operation to run. Fetch, extract, and research are supported only when provider is sofya.

depth'standard' | 'deep'

Search depth. For Linkup: standard ($0.006) or deep ($0.06). Linkup standard is executed as fast under the hood.

outputType'searchResults' | 'sourcedAnswer' | 'structured'

Output format. Linkup supports searchResults, sourcedAnswer, and structured. Non-Linkup providers currently support searchResults only.

structuredOutputSchemastring

JSON schema string defining the desired response format. Required when outputType is 'structured'

includeImagesboolean

Whether to include image results in the search

fromDatestring

Filter results from this date (YYYY-MM-DD format)

toDatestring

Filter results until this date (YYYY-MM-DD format)

excludeDomainsstring[]

Array of domains to exclude from search results

includeDomainsstring[]

Array of domains to search exclusively

maxResultsinteger

Maximum results. Sofya search accepts 1-20.

topic'general' | 'news'

Sofya search or research topic.

freshnessstring

Sofya freshness window: day, week, month, year, or YYYY-MM-DD:YYYY-MM-DD.

urlsstring[]

One to ten URLs for Sofya fetch.

includeRawHtmlboolean

Whether Sofya fetch should include raw HTML.

urlstring

URL for Sofya extract.

promptstring

Instructions describing what Sofya should extract from the URL.

maxSourcesinteger

Maximum sources for Sofya research.

Example request

{
  "query": "latest AI news",
  "provider": "linkup",
  "structuredOutputSchema": "{\"type\": \"object\", \"properties\": {\"items\": {\"type\": \"array\"}}}",
  "fromDate": "2025-01-01",
  "toDate": "2025-07-01",
  "excludeDomains": [
    "example.com",
    "spam.com"
  ],
  "includeDomains": [
    "trusted.com",
    "official.org"
  ]
}

Response

Web search response with results based on output type

Changes