Skip to main content
All requests require an API key. See Authentication.
POST https://api.snipex.dev/v1/search

Request body

query
string
required
The search query. This is what Snipex searches for and extracts snippets relevant to.
num_results
integer
default:"5"
Number of search results to retrieve and extract from. Range: 110.
max_snippets_per_result
integer
default:"3"
Maximum number of snippets to extract per result. Range: 15.The actual number returned may be lower if the page doesn’t contain enough relevant passages.
search_depth
string
default:"balanced"
Controls how deeply the extraction engine analyzes each page.
  • "precise" — fewer snippets, higher confidence, fastest
  • "balanced" — default, good mix of speed and coverage
  • "exhaustive" — maximum snippets, most thorough
See Search Depth for details.
recency
string
Filter results by publish date. One of: "day", "week", "month", "year".Omit or set to null for no filter (default).
language
string
default:"en"
Language code for results (e.g. "en", "fr", "de").
include_domains
string[]
default:"[]"
Restrict results to these domains only. Pass bare domain names: ["nature.com", "bbc.com"].
exclude_domains
string[]
default:"[]"
Exclude these domains from results. Pass bare domain names: ["reddit.com"].
debug
boolean
default:"false"
When true, adds original_content, search_snippet, head, and tail fields to the response.Do not use in productionoriginal_content can be very large.

Response

query
string
The query string from your request, echoed back.
results
SearchResult[]
Ranked array of search results, each containing extracted snippets.
total_latency_ms
integer
Total time taken for the request, in milliseconds.

Example

curl -X POST https://api.snipex.dev/v1/search \
  -H "Authorization: Bearer snx_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "how does CRISPR gene editing work",
    "num_results": 2,
    "search_depth": "balanced",
    "recency": "year"
  }'

Error codes

StatusMeaning
400 Bad RequestMissing or invalid query field
401 UnauthorizedMissing or invalid API key
422 Unprocessable EntityRequest body failed validation — check parameter types and ranges
429 Too Many RequestsRate limit exceeded
500 Internal Server ErrorUnexpected server-side error