API Endpoints
AnySearch provides three APIs for search, capability discovery and public URL content extraction. Use /v1/search for general or vertical queries, and /v1/sub-domains to discover vertical capabilities and parameters when needed. With a public webpage URL, optionally call /v1/extract directly to retrieve its content.
Create an account and API Key
No API Key? Use a registration endpoint to create an account and a default key. Registration does not require Authorization.
Email registration
POST /v1/auth/email/registerCreate an account and receive a default API Key in one request.
- 1
- 2
- 3
- 4
- 5
curl -X POST https://api.cn.anysearch.com/v1/auth/email/register \
-H "Content-Type: application/json" \
-d '{
"email": "dev@example.com"
}'
data.api_key.keyThe plaintext key is returned once. Save it securely immediately.View success response
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
{
"code": 0,
"message": "success",
"data": {
"username": "dev@example.com",
"email": "dev@example.com",
"api_key": {
"key": "as_sk_5d1f0c9a7b3e4d2f8a6c1b0e9d7f3a52",
"name": "default"
}
}
}
Agent registration
POST /v1/api/bot/challengePOST /v1/api/bot/registerGet a challenge, solve it, then submit the answer. Suitable for autonomous agents.
- 1
- 2
- 3
curl -X POST https://api.cn.anysearch.com/v1/api/bot/challenge \
-H "Content-Type: application/json" \
-d '{}'
- 1
- 2
- 3
- 4
- 5
- 6
curl -X POST https://api.cn.anysearch.com/v1/api/bot/register \
-H "Content-Type: application/json" \
-d '{
"challenge_id": "ch_9c1f4b2a7d0e4f6b8a3c5d9e1f2a4b6c",
"answer": "89.05"
}'
data.api_keyThe plaintext key is returned once. Save it securely immediately.View success response
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
{
"code": 0,
"message": "success",
"data": {
"username": "as_auto_q3Jk9xLm2Ab",
"password": "K7mQ2xRtbV9d",
"api_key": "as_sk_5d1f0c9a7b3e4d2f8a6c1b0e9d7f3a52",
"expires_at": null
}
}
code; some email registration failures still return HTTP 200. Do not log the full response. The key and password are returned once. For registration, request_id is mainly returned in the X-Request-ID response header.How the APIs work together
WHEN NEEDED · DISCOVER
Discover capabilities
For vertical search, read available tags and parameters first. General search can start with a query.
SEARCH
Run a search
Submit query, with a tag and capability parameters when needed.
RESULTS
Use the results
Read returned titles, URLs, snippets and available content.
WHEN NEEDED · EXTRACT
POST/v1/extractExtract content
Call directly with a public webpage URL, or optionally extract content from a search result URL for summarization or analysis.
Choose an API
| Task | API | Quota and next step |
|---|---|---|
| General or vertical search | POST/v1/search | Uses search quota; extract content afterward if needed. |
| Discover tags and parameters | GET/v1/sub-domains | Does not consume free or paid search quota; use the definitions in Search. |
| Read public webpage content | POST/v1/extract | Subject to quota; consult the applicable billing rules. |
Complete call example
- 1
curl "https://api.cn.anysearch.com/v1/sub-domains?domain=academic"
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
{
"code": 0,
"message": "success",
"request_id": "<DISCOVERY_REQUEST_ID>",
"data": {
"domains": [
{
"domain": "academic",
"description": "Scholarly paper search, biomedical literature, preprints, citations, datasets",
"sub_domains": [
{
"sub_domain": "academic.paper",
"description": "Cross-discipline paper search by keyword, title, author, institution with metadata and open access links"
},
{
"sub_domain": "academic.citation",
"description": "Citation relationships, citation counts, reference lists by DOI or title"
}
]
}
]
}
}
data.domains[0].sub_domains[0].sub_domain → academic.paper as the tag for the next step- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
curl -X POST https://api.cn.anysearch.com/v1/search \
-H "Authorization: Bearer YOUR_ANYSEARCH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "全球AI芯片产业研究",
"tag": "academic.paper",
"max_results": 5
}'
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
{
"code": 0,
"message": "success",
"request_id": "<VERTICAL_SEARCH_REQUEST_ID>",
"data": {
"results": [
{
"title": "Artificial Intelligence (AI) Chip Market Size, Share, Trends, and Forecast (2024–2030)…",
"url": "https://doi.org/10.5281/zenodo.17599539",
"snippet": "The global Artificial Intelligence (AI) Chip Market, valued at USD 52.92 billion in 2024, is projected to reach USD 295.56 billion by 2030, growing at a CAGR of 33.2% from 2025 to 2030."
}
],
"metadata": {
"total_results": 5,
"search_time_ms": 827
}
}
}
data.results[0].url → Pass it unchanged to Extract as url- 1
- 2
- 3
- 4
- 5
- 6
curl -X POST https://api.cn.anysearch.com/v1/extract \
-H "Authorization: Bearer YOUR_ANYSEARCH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://doi.org/10.5281/zenodo.17599539"
}'
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
{
"code": 0,
"message": "success",
"request_id": "<EXTRACT_REQUEST_ID>",
"data": {
"url": "https://doi.org/10.5281/zenodo.17599539",
"title": "Artificial Intelligence (AI) Chip Market Size, Share, Trends, and Forecast (2024–2030)…",
"content": "Published November 13, 2025 | Version v1 … The global Artificial Intelligence (AI) Chip Market, valued at USD 52.92 billion in 2024, is projected to reach USD 295.56 billion by 2030, growing at a CAGR of 33.2% from 2025 to 2030. Rising adoption of AI-driven technologies …"
}
}
The global Artificial Intelligence (AI) Chip Market, valued at USD 52.92 billion in 2024, is projected to reach USD 295.56 billion by 2030, growing at a CAGR of 33.2% from 2025 to 2030.
Published November 13, 2025 | Version v1 …The global Artificial Intelligence (AI) Chip Market, valued at USD 52.92 billion in 2024, is projected to reach USD 295.56 billion by 2030, growing at a CAGR of 33.2% from 2025 to 2030.Rising adoption of AI-driven technologies …
Request examples
General search only needs query. The examples below show the same request in five languages. See the Search page for vertical search examples.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
curl -X POST https://api.cn.anysearch.com/v1/search \
-H "Authorization: Bearer YOUR_ANYSEARCH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "Global AI Semiconductor Industry Analysis",
"max_results": 5
}'
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
import os
import requests
response = requests.post(
"https://api.cn.anysearch.com/v1/search",
headers={
"Authorization": f"Bearer {os.environ['ANYSEARCH_API_KEY']}",
},
json={
"query": "Global AI Semiconductor Industry Analysis",
"max_results": 5,
},
timeout=30,
)
if not response.ok:
request_id = response.headers.get("X-Request-ID", "unknown")
raise RuntimeError(
f"Request failed: HTTP {response.status_code}; request_id={request_id}"
)
result = response.json()
print(result["data"])
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
const response = await fetch("https://api.cn.anysearch.com/v1/search", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ANYSEARCH_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: "Global AI Semiconductor Industry Analysis",
max_results: 5,
}),
signal: AbortSignal.timeout(30_000),
});
if (!response.ok) {
const requestId = response.headers.get("X-Request-ID") ?? "unknown";
throw new Error(
`Request failed: HTTP ${response.status}; request_id=${requestId}`
);
}
const result = await response.json();
console.log(result.data);
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
package main
import (
"encoding/json"
"fmt"
"net/http"
"os"
"strings"
"time"
)
func main() {
req, err := http.NewRequest(
http.MethodPost,
"https://api.cn.anysearch.com/v1/search",
strings.NewReader(`{
"query": "Global AI Semiconductor Industry Analysis",
"max_results": 5
}`),
)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ANYSEARCH_API_KEY"))
req.Header.Set("Content-Type", "application/json")
client := &http.Client{Timeout: 30 * time.Second}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
requestID := resp.Header.Get("X-Request-ID")
if requestID == "" {
requestID = "unknown"
}
panic(fmt.Sprintf(
"Request failed: HTTP %d; request_id=%s",
resp.StatusCode, requestID,
))
}
var result struct {
Data json.RawMessage `json:"data"`
}
if err := json.NewDecoder(resp.Body).Decode(&result); err != nil {
panic(err)
}
fmt.Println(string(result.Data))
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
use reqwest::blocking::Client;
use serde_json::{json, Value};
use std::{env, error::Error, time::Duration};
fn main() -> Result<(), Box<dyn Error>> {
let api_key = env::var("ANYSEARCH_API_KEY")?;
let client = Client::builder()
.timeout(Duration::from_secs(30))
.build()?;
let response = client
.post("https://api.cn.anysearch.com/v1/search")
.bearer_auth(api_key)
.json(&json!({
"query": "Global AI Semiconductor Industry Analysis",
"max_results": 5,
}))
.send()?;
if !response.status().is_success() {
let request_id = response
.headers()
.get("X-Request-ID")
.and_then(|value| value.to_str().ok())
.unwrap_or("unknown");
return Err(format!(
"Request failed: HTTP {}; request_id={request_id}",
response.status()
)
.into());
}
let result: Value = response.json()?;
println!("{}", result["data"]);
Ok(())
}
https://api.cn.anysearch.com
Content type Use Content-Type: application/json for POST requests.Browse domains and capabilities
Find the right capability for your task, then read its parameter definitions before running a vertical search.
Common response envelope
The server generates a UUID v4 request_id for each response and returns the same value in the X-Request-ID response header. A caller-supplied request ID is ignored.
| Field | Success | Error |
|---|---|---|
code | 0 | -1 |
message | "success" | Error description; HTTP 402 may include credentials. |
request_id | Server-generated UUID v4 | Use for diagnostics. |
data | Endpoint-specific data | Inspect the actual response. |
error_code | Usually omitted | Optional stable error identifier. |
- 1
- 2
- 3
- 4
- 5
- 6
{
"code": 0,
"message": "success",
"request_id": "7d6f4e91-2a83-4c5b-9f10-6e8a3d27b541",
"data": {}
}
Error codes: Search, Sub-domains, Extract.
FAQ
Must I discover capabilities before a general search?
No. A general search only needs query. Discover definitions when you need a specific vertical capability.
Does format=markdown return a plain Markdown response?
No. The outer Search response remains JSON. The content field uses Markdown.
Does capability discovery consume search quota?
No. It does not consume free or paid search quota or count as search usage. Requests may still be rate limited.
What content can Extract read?
Public HTTP(S) pages containing HTML/XHTML, plain text, JSON or Markdown. PDF, images, audio and video are unsupported.