API Usage
This guide explains how to use the Anyshot.io API, including details about each request body field and the associated credit costs.
Take a Snapshot
Endpoint
POST https://api.anyshot.io/api/v1/snapshot
This endpoint captures a snapshot of a given URL.
Request Headers
| Header | Value | Description |
|---|---|---|
| Authorization | Bearer <CLIENT_ID:API_KEY> | Replace <CLIENT_ID:API_KEY> with your actual client ID and API key. |
| Content-Type | application/json | Specifies that the request body is in JSON format. |
Request Parameters
The request body must be a JSON object containing the following fields.
1. url (Required)
- Usage: Provide the URL of the page you want to capture.
- Feature: This is the main input parameter and must be specified.
- Example:
{
"url": "https://www.example.com"
} - Cost: Most domains are included, premium domains may have additional charges. See the Premium Domains for details.
2. country (Required)
- Usage: Provide the country code (Alpha-2) to specify the region for the snapshot.
- Feature: Allows targeting specific geographic locations for accurate content capture.
- Note: If
auto_discoveryis enabled, thecountryflag is ignored. - Example:
{
"url": "https://www.example.com",
"country": "US"
} - Cost: Most countries are included, premium countries may have additional charges. See the Premium Countries for details.
3. auto_discovery (Optional)
- Usage: Use if you are unsure from where the site can be accessed.
- Feature: Enables automatic proxy selection to find an accessible route to the target website.
- Note: If enabled, the
countryparameter is ignored. - Example:
{
"url": "https://www.example.com",
"auto_discovery": true
} - Cost: +10 credit if enabled.
4. full_page (Optional)
- Usage: Enable this option to capture the entire webpage, not just the visible viewport.
- Feature: Scrolls and stitches together the full page for a complete snapshot.
- Example:
{
"url": "https://www.example.com",
"country": "US",
"full_page": true
} - Cost:
- 1MB or less: Free.
- For each additional 1MB: +10 credits.
5. extra_stealth (Optional)
- Usage: Use when stronger evasive techniques are required.
- Feature: Helps bypass bot detection and access restricted pages.
- Example:
{
"url": "https://www.example.com",
"country": "US",
"extra_stealth": true
} - Cost: +5 credits if enabled.
6. ai_extraction (Optional)
-
Usage: Enable this option to extract AI-processed content from the page.
-
Feature: Uses AI-based techniques to identify and extract meaningful content.
-
Example:
{
"url": "https://www.ebay.com/itm/124874082612",
"country": "US",
"ai_extraction": true,
"full_page": true
} -
Response:
{
"url": "https://www.ebay.com/itm/124874082612",
"results": {
"title": "example page",
"item": {
"name": "Lightsaber Color Changing Metal Dueling RGB",
"price": 388.9,
"currency": "$"
}
}
} -
Cost: +25 credits if enabled.
- 1MB or less: Free.
- For each additional 1MB: +15 credits.
-
NOTE: Custom AI extraction is coming soon...
6. format (Optional)
- Usage: Enable this option to set the response image format (default
png) - Options:
png/jpeg/webp - Example:
{
"url": "https://www.example.com",
"country": "US",
"format": "jpeg"
}
Credit Cost Summary
| Feature | Credit Cost |
|---|---|
| URL | Included/Varies (See Premium Domains) |
| Country | Included/Varies (See Premium Countries) |
| Screenshot size | Up to 1MB Free, For each additional 1MB +10 credits |
| Auto Discovery | +10 credit |
| Extra Stealth | +5 credits |
| AI Extraction | +25 credits, First MB Free, For each additional 1MB +15 credits |
Response
The API returns the snapshot image as a stream.
Custom Headers
The following custom headers are returned in the response to provide additional information about the request and the snapshot:
| Header Name | Value | Explanation |
|---|---|---|
X-Anyshot-Country-Code | us | The country code (Alpha-2) in which the snapshot was captured. |
X-Anyshot-Country-Name | United States | The full name of the country corresponding to the country code. |
X-Anyshot-Credit-Used | 35 | The total number of credits consumed for the request. |
X-Anyshot-Elapsed-Sec | 15.18 | The time taken to process the snapshot, in seconds. |
X-Anyshot-Image-Size-Kb | 26.14 | The size of the captured image, in kilobytes (KB). |
Example cURL Command
curl -v -X POST https://api.anyshot.io/api/v1/snapshot \
-H "Authorization: Bearer <CLIENT_ID:API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.example.com",
"full_page": true,
"extra_stealth": true,
"country": "US"
}' \
-o output.png