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:

