Get Websites API Endpoint
Get Websites API Endpoint
URL: /v1/websites
Method: GET
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
account_id | string | ✅ | The public ID of the account/user making the request |
ids | array[string] | ❌ | Array of specific website IDs to retrieve. If not provided, returns all websites for the account |
domain | string | ❌ | Filter websites by domain |
Request Body Structure
[ { "account_id": "acct_1234567890", "ids": ["web_abc123", "web_def456"], "domain": "example.com" }]Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | ✅ | JSON-encoded request body containing the json array |
limit | integer | ❌ | Maximum number of results to return (default: system limit) |
paging | object | ❌ | Pagination parameters for cursor-based pagination |
Response Structure
{ "results": [ { "id": "web_abc123", "name": "Example Website", "url": "https://example.com", "status": "active", "created_at": "2023-01-01T00:00:00Z", "updated_at": "2023-01-01T00:00:00Z", ... } ], "errors": [], "paging": {...}}Error Responses
| Error Code | Description |
|---|---|
account_not_found | The provided account_id does not exist |
website_not_found | One or more specified website IDs do not exist |
website_public_id_invalid | Invalid format for website public ID |
json_is_invalid | Invalid JSON in the request body |
Paging
All GET requests are subject to paging, please refer to Result Paging for details.
Response Details
The response will look like:
{ "results": [], "errors": [], "scrolling": {}}errors will have 0 or more of the error object.
paging is an object that indicates if there are more results to retrieve. Please see paging
results will be 0 or more objects with this shape:
{ "account_id": "<string>", "id": "<string>", "name": "<string>", "url": "<string>", "page_views": <integer>, "scan_period": "<enum{'disabled', 'weekly', 'monthly', 'trimonthly'}>", "report": { "id": "<string>", "created_at": "<string>" }, "subdomains": [ "<string{http(s) scheme required}>" ], "additional_scan_urls": [ "<string{http(s) scheme required}>" ], "cookie_count": <integer>, "cookie_policy_document_id": "<string>", "unclassified_cookie_count": <integer>, "company": { "legal_name": "<string>", "email": "<string>", "phone": "<string>", "fax": "<string>", "address": "<string>", "zip": "<string>", "state": "<string>", "city": "<string>", "country": "<string>" }, "consent_count": <integer>, "code_snippet": { "banner": "<string>", "cookie_preference_button": "<string>" }, "api_key": "<string>"}account_idunique identifier of the account that owns the websiteidunique identifier of the websitenamename of the websiteurlurl of the website including http protocolpage_viewsnumber of page views that this site has had with the termly banner installedscan_periodhow often the website will be scanned (on ofweekly,monthly,trimonthly)reportobject describing the latest successful scan resultidunique identifier for the reportcreated_attimestamp of when the report was created
subdomainsan array of subdomains that the scanner will scan as well- Note: This field is deprecated. Please use
additional_scan_urlsinstead. - items are strings
- http/https scheme is required
- Must be a subdomain of the ‘url’ field
- Note: This field is deprecated. Please use
additional_scan_urlsan array of urls that the scanner will scan as well. This allows you to ensure a specific page is scanned.- items are strings
- http/https scheme is required
- Must be a subdomain of, or match the domain in, the ‘url’ field
cookie_counttotal number of cookies foundcookie_policy_document_idunique identifier of the cookie policy documentcompanyobject containing all the company related informationlegal_namelegal name of the companyemailpublic contact email for the companyphonepublic phone number for the companyfaxcompany fax numberaddressstreet address of the companyzipzip code for the companystatestatecitycitycountrycountry
consent_countnumber of users who have consented to cookiescode_snippetobject that contains JavaScript snippets to install termly on the websitebannerJavaScript snippet to install the banner on the website- Note: The auto blocker is enabled by default with
autoBlock=onin the snippet. It may be manually disabled by changing the snippet toautoBlock=off
- Note: The auto blocker is enabled by default with
cookie_preference_buttonJavaScript snippet to install the preferences button on the website
api_keyWordPress API key of the website
Example 1
Request all websites for a given account
Body
[ { "account_id": "acct_1234" }]Example 2
Multiple accounts and websites in each account and one website cannot be found
Body
[ { "account_id": "acct_123", "ids": ["web_123"] },
{ "account_id": "acct_1234", "ids": ["web_13", "web_14"] }]Example 3
Request with ids parameter but value is empty array
Body
[ { "account_id": "acct_123", "ids": [] }]This would result in an error response
{ "results": [], "errors": [ { "_idx": 0, "error": "validation_error", "validation_errors": [ { "field": "ids", "message": "is_missing" } ] } ], "paging": {}}Example 4
Request with domain parameter
Body
[ { "account_id": "acct_123", "domain": "example.com" }]This would result in a response containing websites for all domains and subdomains for example.com.
Note that the value of some fields in the result objects (websites) have been removed to reduce clutter in the example.
{ "results": [ { "account_id": "acct_123", "code_snippet": { "banner": "", "cookie_preference_button": "" }, "company": null, "consent_count": 0, "cookie_count": 0, "cookie_policy_document_id": null, "id": "web_0228b3ea-edc7-44e2-b9e1-69ehhe46db8d", "name": "docs", "page_views": 0, "report": { "id": null, "created_at": null }, "scan_period": "disabled", "subdomains": [], "additional_scan_urls": [], "unclassified_cookie_count": 0, "url": "https://example.com", "uuid": "0228b3ea-edc7-44e2-b9e1-69ehhe46db8d", "api_key": "" }, { "account_id": "acct_123", "code_snippet": { "banner": "", "cookie_preference_button": "" }, "company": null, "consent_count": 0, "cookie_count": 0, "cookie_policy_document_id": null, "id": "web_1ert70gg-d313-4b2d-9ch0-v4b29f41ec2c", "name": "Test", "page_views": 0, "report": { "id": null, "created_at": null }, "scan_period": "disabled", "subdomains": [], "additional_scan_urls": [], "unclassified_cookie_count": 0, "url": "https://info.termly.io", "uuid": "1ert70gg-d313-4b2d-9ch0-v4b29f41ec2c", "api_key": "" } ], "errors": [], "paging": {}}