Get /v1/sub-domains

Published

Returns the available sub-domains and their parameter definitions for one or more search domains.

Does not consume free or paid search quota · Does not count as search usage.

Request Parameters

FIELDTYPEREQUIREDDESCRIPTION
domainstring[]YesRepeat the query parameter to request multiple domains.
Multiple domains: use ?domain=code&domain=finance. Do not send domains or a comma-separated list.

Repeated values do not produce duplicate entries. Unknown domains return HTTP 200 with an empty data.domains array.

Request Example

bash
  1. 1
  2. 2

curl 'https://api.anysearch.com/v1/sub-domains?domain=code&domain=finance' \

-H "Authorization: Bearer YOUR_ANYSEARCH_API_KEY"

Response Format

FIELDDESCRIPTION
data.domainsRequested domain capability list.
sub_domainsAvailable sub-domain definitions.
sub_domainFull capability tag, for example code.snippet.
paramsParameter definitions keyed by name; omitted when the sub-domain has no parameters. Each definition includes description, required, and sort_order.

Response Example

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
  40. 40
  41. 41
  42. 42
  43. 43

{

"code": 0,

"message": "success",

"request_id": "3c7e91b5-6a24-4fd8-b310-2e9a6c54f781",

"data": {

"domains": [

{

"domain": "code",

"description": "Developer documentation and code search",

"sub_domains": [

{

"sub_domain": "code.snippet",

"description": "Search real code implementations",

"params": {

"lang": {

"description": "Filter by programming language",

"required": false,

"sort_order": 0

}

}

}

]

},

{

"domain": "finance",

"description": "Financial data and market information",

"sub_domains": [

{

"sub_domain": "finance.quote",

"description": "Real-time and historical quotes for stocks, forex, crypto, commodities, indices, ETFs, futures",

"params": {

"type": {

"description": "Asset type. Values: `stock` (global stocks + A-shares), `forex` (foreign exchange), `crypto` (cryptocurrency), `commodity` (commodities), `index` (Chinese indices), `etf` (Chinese ETFs)",

"required": true,

"sort_order": 0

}

}

}

]

}

]

}

}

Error Responses

STATUSDESCRIPTION
400The domain query parameter is missing.
429Request rate limit exceeded.
502Domain definitions failed to load.

missing domain

json
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5

{

"code": -1,

"message": "At least one domain parameter is required.",

"request_id": "9a4d2f68-1b75-4c3e-8f20-6d91a7b5c432"

}