### 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:

Authentication

Acquire your API key by following the instructions in the Authentication section

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.

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.

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](68b5f6f7d688be390d72048c/68b5add5d688be390d5e5af0). ### Next Steps Now that you've made your first successful request: #### **Recommended Actions** 1. [**Check your credit balance**](68b5f6f7d688be390d72048c/68b36d640ffb10e152353cfa/68b363d8cca117a351a9c0a1) - Monitor usage and costs 2. [**Browse popular use cases**](68b5cb5a46df0833c3a6612a) - Learn about additional ways to leverage our data 3. [**Understand error handling**](68b5f6f7d688be390d72048c/68b5c0743726dd7779aea825) - Get familiar with the different erros **Questions or Need Help?** Our [support team](https://www.similarweb.com/corp/contact-us/) is ready to help you build successful integrations and maximize the value of your API access.