The DeepSeek Search and Fetch APIs provide programmatic access to live web content for agents and retrieval‑augmented generation systems. The Search API is invoked with a POST to https://api.deepseek.com/v1/tools/search, supplying a JSON body that includes a required query string (1‑128 Unicode characters), an optional count (1‑50, default 10), and a boolean need_content flag to request the full page markup. Advanced query syntax supports site:, -site:, -term, -"phrase", "exact phrase", lang:, after:, and before: operators. A successful request returns HTTP 200 with a results array; each result contains rerank_score (0‑3, ≥1.5 high‑quality), title, URL, snippet (100‑200 chars), summary (600‑800 chars), optional content, site name/icon, publication date (RFC 3339), and an authority tier (0‑4). The Fetch API retrieves a single page via POST to https://api.deepseek.com/v1/tools/fetch with a mandatory URL field (≤8192 chars, HTTP/HTTPS, no credentials) and returns JSON with title and content as Markdown. Both APIs use bearer token authentication (Authorization: Bearer ) and Content‑Type: application/json. Billing is $0.75 per 1,000 successful requests for each API, counting only requests that yield HTTP 200 and a non‑empty results array (Search) or page content (Fetch). Rate limits are 5 QPS per account for Search and Fetch independently, with Fetch additionally enforcing a per‑domain QPS limit; exceeding limits triggers HTTP 429. Error handling follows an OpenAI‑compatible format, with status codes 400‑504 indicating various client, authentication, quota, and server issues.
Read original
hackernews