Overview
The Web Search API provides comprehensive search capabilities across multiple content types:General & News
Web-wide and news-specific searches with domain filtering
Media Search
Find images and videos from across the web
Specialized Search
Shopping results and academic papers from scholarly sources
Pricing
Simple, transparent pricing
- Standard searches: 1 per 1,000 requests)
- Shopping searches: 2 per 1,000 requests)
Authentication
All requests require authentication via Bearer token in the Authorization header:Endpoint
POST /api/v1/web_search
Search the web with various search types and filtering options.
SDK Support
Request Body
The search query. Be specific for better results.
Type of search to perform.
general
- Standard web search ($0.001)news
- Recent news articles ($0.001)images
- Image search ($0.001)videos
- Video search ($0.001)shopping
- Product search ($0.002)scholar
- Academic papers ($0.001)
Geographic location for localized results. Uses two-letter country codes.Examples:
us
, uk
, ca
, au
, de
, fr
, jp
, in
, br
Filter results by time period.Options:
hour
, day
, week
, month
, year
Leave unset for all-time results. Only applies to general and news searches.
Include or exclude specific domains from results.
- Include domains:
["example.com", "trusted-source.org"]
- Exclude domains with
-
prefix:["-spam-site.com"]
- Mix both:
["trusted.com", "-untrusted.com"]
Only applies to general search type.
Response
Array of search results. Structure varies by search type.
Cost in USD for this request.
- Standard searches: $0.001
- Shopping searches: $0.002
Response Fields by Search Type
General Search
Returns up to 10 results with the following fields:Title of the search result
URL of the result
Brief description or excerpt
Publication date (when available)
News Search
Returns up to 10 news articles with the following fields:Article headline
URL to the article
Article excerpt
Publication date
News source/publisher
Article thumbnail or main image
Result position in search results
Image Search
Returns up to 10 images with the following fields:Image title or alt text
Direct URL to the full-size image
URL to thumbnail version
Image width in pixels
Image height in pixels
Source website name
URL of the page containing the image
Video Search
Returns up to 10 videos with the following fields:Video title
URL to the video page
Video description
Direct video URL (when available)
Video duration (format varies by source)
Video platform/source
Channel or creator name
Upload or publication date
Result position
Video thumbnail URL
Shopping Search
Returns up to 10 products with the following fields:Product name/title
Merchant or marketplace name
URL to product page
Product price (includes currency symbol)
Product image URL
Product rating (typically 0-5 scale)
Number of ratings/reviews
Product identifier
Result position
Scholar Search
Returns up to 10 academic papers with the following fields:Paper title
URL to paper or abstract
Abstract or excerpt
Journal, conference, or publication details
Publication year
Number of citations
Direct PDF link (when available)
Error Handling
The API returns detailed error information in a consistent format:Error Response Format
Common Error Codes
Authentication Errors (401)
Authentication Errors (401)
missing_llmlayer_api_key
- No API key provided or invalid key
Validation Errors (400)
Validation Errors (400)
invalid_search_type
- Search type not supported
Rate Limit Errors (429)
Rate Limit Errors (429)
- Subject to your plan’s API rate limits
Server Errors (500)
Server Errors (500)
- Internal server errors
Limitations
- Returns up to 10 results per search
recency
filter only works withgeneral
andnews
search typesdomain_filter
only works withgeneral
search type- Shopping searches cost 2x standard searches due to additional complexity
Next Steps
Answer API
Combine search with AI-powered answers
Scraper API
Extract detailed content from URLs
Quickstart Guide
Get started with LLMLayer
Need Help? Join our Discord or email support@llmlayer.ai