Quick Start
Make your first web search request and read the results.
Web Search is currently served through the COM site and Hong Kong API. To try it online first, sign in to the Web Search Playground, enter a query, and browse the clickable results.
Get credentials
Create an API key and copy your project ID from API key settings. Send them in the X-API-Key and X-Project-Id headers. Both must belong to the same project. Keep API keys on your server, out of browser code and public repositories.
Search the web
BASE_URL='https://api.lexmount.com'
API_KEY='<your-api-key>'
PROJECT_ID='<your-project-id>'
curl -sS "$BASE_URL/v1/search" \
-H 'Content-Type: application/json' \
-H "X-API-Key: $API_KEY" \
-H "X-Project-Id: $PROJECT_ID" \
--data '{
"query": "PostgreSQL replication",
"limit": 20,
"timeout_ms": 10000
}'This request returns up to 20 deduplicated results. Omitting limit sets the maximum to 10.
Read page URLs, titles, and snippets from results; returned is the actual count. Results in a partial response are usable but may be incomplete. An empty partial response does not establish that no relevant pages exist. See the complete response example.
Set language, region, and domains
curl -sS "$BASE_URL/v1/search" \
-H 'Content-Type: application/json' \
-H "X-API-Key: $API_KEY" \
-H "X-Project-Id: $PROJECT_ID" \
--data '{
"query": "PostgreSQL replication",
"limit": 20,
"language": "en",
"region": "US",
"filters": {
"include_domains": ["postgresql.org"]
}
}'Language and region are preferences, not guarantees about every result. filters.include_domains is a strict filter that keeps only matching domains and their subdomains.
Set a time budget
timeout_ms defaults to 10000 milliseconds and accepts 1000–60000. Set your client timeout above that budget to allow time for request transmission, network latency, and response transfer.
Read the response body even for HTTP 503. When reporting a problem, retain request_id or the X-Request-ID response header.
For HTTP 401, check the API key. For 403, check that the project matches and the request origin meets service-region restrictions. region affects search preferences, not API access restrictions. See Search API for all fields and errors.
