You need an API key to follow this guide. Get one from the API Console.
Setup
Store your API key as an environment variable rather than hardcoding it:Complete example
How it works
- API key from environment — loaded from
ANDI_API_KEY, never hardcoded - Query parameters —
qfor the search query,limitto cap results at 5 - Status code check — handle success, rate limiting, and other errors separately
- Result parsing — each result has
title,link,desc, andsource
Variations
With text extracts
Addextracts=true to get longer text passages from each result page:
With domain filtering
Restrict results to specific sites:Context format for LLMs
Get results as markdown text, ready to pass into an LLM prompt:Next steps
RAG pipeline
Use search results as context for an LLM.
Query parameters
Full parameter reference.
Error handling
Error codes and retry strategies.
Response format
Understand the response structure.

