Subscribe to webhook events

Subscribe to event notifications to stay updated on the release of new daily or monthly website data. Each event type allows only one subscription. Ensure that the subscription URL does not exceed 255 characters.

📘

Pricing information

There are no credit costs associated with subscribing to webhook events.

👍

Event Types

You can subscribe to the following types of events:

  • Daily: Data for a specific date is released within 72 hours following the close of that date (EST).
  • Monthly: Monthly data is consistently released by the 10th of the following month, often sooner.
    Note: A single subscription per event type is permitted.

Endpoint URL:

To initiate a subscription, use the following endpoint URL. Replace {{YOUR_SIMILARWEB_API_KEY}} with your actual Similarweb API key.

https://api.similarweb.com/v1/webhooks/subscribe?api_key={{YOUR_SIMILARWEB_API_KEY}}

Parameters:

'api_key': Your unique Similarweb API key. Include this parameter in the request URL without the {{ }} brackets.

Example Request:

Below is an example curl request for subscribing to a webhook. Replace {{similarweb_api_key}} with your actual API key and adjust the web_hook_event_type and url as needed.

curl --location -g 'https://api.similarweb.com/v1/webhooks/subscribe?api_key={{similarweb_api_key}}' \
--data '{
   "webhook_event_type": "Daily", // Daily, Monthly
   "url":"https://hook.listener.com"
}
'

Example Response:

After subscribing, the server responds with a JSON object containing details about your subscription. Below is an example of such a response:

{
  "subscription_id": "1456e7-b50e-4554-9d35-8845656560",
  "webhook_event_type": "Daily",
  "url": "https://hook.listener.com",
  "last_update_date": null
}

Tips for Subscribing:

  • Double-check the web_hook_event_type and url parameters to ensure they are correctly specified.
  • Review the URL limitations and ensure your target URL is within the 255 character limit.
  • Utilize the correct HTTP method (POST) when making your subscription request.