Home/APIs/Web Search
Web Search API

Search the Web
Programmatically

6 search types. 40+ locations. Real-time results. One simple API.

$0.002per search
response.json
{
  "results": [
    {
      "title": "OpenAI GPT-5 Release...",
      "link": "https://example.com/...",
      "snippet": "Latest AI breakthrough...",
      "date": "2025-01-20"
    },
    // ... up to 10 results
  ],
  "cost": 0.002
}
6
Types
40+
Locations
10
Results
Search Types

Six Ways to Search

Each search type returns structured data optimized for its content category.

$0.002

General

Web-wide search across all indexed pages

titlelinksnippetdate
$0.002

News

Breaking news and recent articles

titlelinksnippetsource+2
$0.002

Images

High-resolution images with metadata

titleimageUrlthumbnailUrlwidth+1
$0.002

Videos

Video content from major platforms

titlelinkvideoUrlduration+1
$0.002

Shopping

Product listings with prices and ratings

titlepriceratingratingCount+1
$0.002

Scholar

Academic papers and citations

titlelinkpublicationInfocitedBy+1
40+ Locations
Target searches by country
Time Filters
Hour to year recency
Domain Control
Include or exclude sites
Quick Start

Start Searching in Minutes

search.py
PYTHON
from llmlayer import LLMLayerClient

client = LLMLayerClient(api_key="...")

# Search the web
response = client.search_web(
    query="latest AI news",
    search_type="news",
    recency="day"
)

for result in response.results:
    print(result.title)
search.ts
TYPESCRIPT
import { LLMLayerClient } from 'llmlayer';

const client = new LLMLayerClient({
  apiKey: process.env.LLMLAYER_API_KEY
});

const { results } = await client.searchWeb({
  query: 'machine learning papers',
  searchType: 'scholar',
  location: 'us'
});

results.forEach(r => console.log(r.title));
TerminalcURL
curl -X POST https://api.llmlayer.dev/api/v2/web_search \
  -H "Authorization: Bearer $LLMLAYER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "best restaurants NYC", "search_type": "general", "location": "us"}'
Reference

API Parameters

POST/api/v2/web_search
PARAMETERTYPEDEFAULTDESCRIPTION
query*stringYour search query
search_typestringgeneralgeneral, news, images, videos, shopping, scholar
locationstringusISO country code (us, uk, de, fr, etc.)
recencystringhour, day, week, month, year (general/news only)
domain_filterarrayInclude/exclude domains, prefix with - to exclude

* Required parameter

Use Cases

Built For

AI Agents

Give your agents real-time web access for research and fact-checking

Content Aggregation

Build news feeds, price trackers, or research databases

Market Research

Monitor competitors, track trends, analyze sentiment

Academic Tools

Search papers, find citations, build research assistants

$0.002per search

Start Searching
Today

Get your API key and search the web in minutes. Free credits to start. No credit card required.