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.

How the APIs work together

WHEN NEEDED · EXTRACT

POST/v1/extract

Extract content

Call directly with a public webpage URL, or optionally extract content from a search result URL for summarization or analysis.

Choose an API

TaskAPIQuota and next step
General or vertical searchPOST/v1/searchUses search quota; extract content afterward if needed.
Discover tags and parametersGET/v1/sub-domainsDoes not consume free or paid search quota; use the definitions in Search.
Read public webpage contentPOST/v1/extractSubject to quota; consult the applicable billing rules.

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.

cURL · macOS / Linux / Git Bash
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7

curl -X POST https://api.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

}'

Python 3 · requests
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23

import os

import requests

​

response = requests.post(

"https://api.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"])

JavaScript · Node.js 18+
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22

const response = await fetch("https://api.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);

Go · Standard library
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
  55. 55

package main

​

import (

"encoding/json"

"fmt"

"net/http"

"os"

"strings"

"time"

)

​

func main() {

req, err := http.NewRequest(

http.MethodPost,

"https://api.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))

}

Rust · reqwest + serde_json
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 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.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(())

}

Base URL https://api.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.

Browse the complete capability directory

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.

FieldSuccessError
code0-1
message"success"Error description; HTTP 402 may include credentials.
request_idServer-generated UUID v4Use for diagnostics.
dataEndpoint-specific dataInspect the actual response.
error_codeUsually omittedOptional stable error identifier.
Success envelope · data depends on the endpoint
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6

{

"code": 0,

"message": "success",

"request_id": "7d6f4e91-2a83-4c5b-9f10-6e8a3d27b541",

"data": {}

}

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.