Skip to main content
POST
/
api
/
v2
/
web_search
Web Search API - Raw search results
curl --request POST \
  --url https://api.llmlayer.dev/api/v2/web_search \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "latest AI news",
  "search_type": "general",
  "location": "us",
  "recency": "hour",
  "domain_filter": [
    "wikipedia.org",
    "-pinterest.com"
  ]
}
'
{
"results": [
{}
],
"cost": 123
}

Authorizations

Authorization
string
header
required

Bearer token authentication using your LLMLayer API key. Include in Authorization header as: Bearer YOUR_LLMLAYER_API_KEY

Body

application/json
query
string
required

The search query

Example:

"latest AI news"

search_type
enum<string>
default:general

Type of search. 'shopping' costs $0.002, others cost $0.001.

Available options:
general,
news,
shopping,
videos,
images,
scholar
location
string
default:us

Country code for localized results (us, uk, ca, etc.)

Example:

"us"

recency
enum<string> | null

Filter results by time period

Available options:
hour,
day,
week,
month,
year
domain_filter
string[] | null

Include/exclude domains. Prefix with '-' to exclude (e.g., ['-reddit.com'])

Example:
["wikipedia.org", "-pinterest.com"]

Response

Raw search results

results
object[]
required

Search results. Structure varies by search_type.

cost
number

Cost in USD. $0.001 for general/news/videos/images/scholar, $0.002 for shopping.