Skip to main content
POST
/
api
/
web
Direct Web Search API
curl --request POST \
  --url https://nano-gpt.com/api/web \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>",
  "provider": "<string>",
  "depth": "<string>",
  "outputType": "<string>",
  "structuredOutputSchema": "<string>",
  "includeImages": true,
  "fromDate": "<string>",
  "toDate": "<string>",
  "includeDomains": [
    "<string>"
  ],
  "excludeDomains": [
    "<string>"
  ]
}
'
{
  "data": [
    {}
  ],
  "metadata": {
    "query": "<string>",
    "provider": "<string>",
    "depth": "<string>",
    "outputType": "<string>",
    "timestamp": "<string>",
    "cost": 123
  }
}

Overview

Use POST /api/web when you want direct control over search requests and output formatting. For chat-first workflows, use POST /api/v1/chat/completions with model suffixes like :online, :online/linkup, or :online/linkup-deep.

When to use which endpoint

Use caseEndpoint
You want the model to answer with web context in one callPOST /api/v1/chat/completions + :online...
You need explicit control over query, outputType, domain/date filters, or structured schema outputPOST /api/web
You need OpenAI-native web searchPOST /api/v1/chat/completions only

Authentication

Either auth header is supported:
Authorization
string
Bearer YOUR_API_KEY
x-api-key
string
YOUR_API_KEY

Request body

query
string
required
Search query string.
provider
string
default:"linkup"
Search provider. openai-native is not allowed on /api/web.
depth
string
default:"standard"
Search depth. For Linkup: standard or deep.
For Linkup, depth: "standard" is executed as Linkup fast under the hood.
outputType
string
default:"searchResults"
Output mode. Allowed values: searchResults, sourcedAnswer, structured.
structuredOutputSchema
string
Required when outputType is structured. Pass a JSON schema string.
includeImages
boolean
default:false
Include image results.
fromDate
string
Earliest result date (YYYY-MM-DD).
toDate
string
Latest result date (YYYY-MM-DD).
includeDomains
string[]
Restrict results to these domains.
excludeDomains
string[]
Exclude these domains.
Linkup supports outputType: "searchResults", "sourcedAnswer", and "structured". Non-Linkup providers currently support only outputType: "searchResults".

Response shape

data
array|object
Provider-formatted payload.
metadata
object
For searchResults, data is an array of normalized results. For sourcedAnswer and structured, data is the provider response object.

Example response

{
  "data": "... provider-formatted payload ...",
  "metadata": {
    "query": "string",
    "provider": "linkup",
    "depth": "standard",
    "outputType": "sourcedAnswer",
    "timestamp": "ISO-8601",
    "cost": 0.006
  }
}

Pricing (hosted key)

ModePrice
Linkup standard$0.006
Linkup deep$0.06

Error codes

HTTP statusMeaning
400Invalid parameters
401Invalid session or auth
402Insufficient balance or usage cap
429Rate limited
503Provider key missing
504Search failed or timed out

Examples

curl -X POST https://nano-gpt.com/api/web \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "What happened in AI this week?",
    "provider": "linkup",
    "depth": "standard",
    "outputType": "sourcedAnswer"
  }'