Making Your First Request
Getting Started
Similarweb API Key
You need a valid API key to authenticate your requests. If you don't have one yet, follow the instructions in the Authentication section to obtain yours.
To make your first API request, follow these steps:
1
Authentication
Acquire your API key by following the instructions in the Authentication section
2
Construct the Endpoint Request
All API requests start with a base URL followed by the specific endpoint you want to access. Refer to the relevant API endpoint in the API Reference for the correct URL structure.
3
Send the request
Use your preferred programming language or tool to send an HTTP GET or POST request to the constructed endpoint. Don't forget to include your API key in the request headers.
4
Receive the Response
The API will respond with data in JSON format. You can parse this data to extract the insights you need for your analysis
Request Example
curl -X GET "https://api.similarweb.com/v5/website-analysis/websites/traffic-and-engagement" \
-H "api-key: YOUR_API_KEY" \
-G \
-d "domain=nike.com" \
-d "metrics=visits,bounce_rate,pages_per_visit" \
-d "granularity=monthly" \
-d "start_date=2024-10-01" \
-d "end_date=2024-12-31"Response Example
{
"meta": {
"request": {
"domain": "nike.com",
"metrics": ["visits", "bounce_rate", "pages_per_visit"],
"granularity": "monthly",
"start_date": "2024-10-01",
"end_date": "2024-12-31",
"country": "WW"
},
"status": "Success",
"last_updated": "2025-01-15"
},
"data": [
{
"date": "2024-10-01",
"visits": 89234567,
"bounce_rate": 0.2891,
"pages_per_visit": 4.32
},
{
"date": "2024-11-01",
"visits": 94123456,
"bounce_rate": 0.2734,
"pages_per_visit": 4.67
},
{
"date": "2024-12-01",
"visits": 102345678,
"bounce_rate": 0.2645,
"pages_per_visit": 4.89
}
]
}API Options: Choose the API that best suits your needs
REST API
This is what we used in the example above. REST API is perfect for:
- Real-time dashboards requiring up-to-date data
- Application integration with on-demand queries
- Quick analysis of specific domains or time periods
- Small to medium data volumes (single/few domains)
Batch API
If you're looking for large-scale analysis, this is the API for you. It's ideal for:
- Historical analysis requiring months/years of data
- Bulk domain research (hundreds to millions of domains)
- Data warehouse loading with direct S3/Snowflake delivery
- Automated reporting with scheduled data updates
Example Batch Request
curl -X POST "https://api.similarweb.com/batch/v4/request-report" \
-H "api-key: YOUR_BATCH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"report_query": {
"tables": [{
"vtable": "traffic_and_engagement",
"granularity": "monthly",
"filters": {
"domains": ["nike.com", "adidas.com", "underarmour.com"],
"countries": ["US", "GB", "DE"]
},
"metrics": ["visits", "bounce_rate", "pages_per_visit"],
"start_date": "2020-01-01",
"end_date": "2024-12-31"
}]
}
}'Learn more about the differenes between Batch and REST APIs and how to use them by visiting this guide.
Next Steps
Now that you've made your first successful request:
Recommended Actions
- Check your credit balance - Monitor usage and costs
- Browse popular use cases - Learn about additional ways to leverage our data
- Understand error handling - Get familiar with the different erros
Questions or Need Help? Our support team is ready to help you build successful integrations and maximize the value of your API access.
What made this section unhelpful for you?
On this page
- Making Your First Request