Snowflake API Integration
Integrate Similarweb Batch API reports into your Snowflake account.
Store, access, and analyze Similarweb data directly from your Snowflake database, so you can easily perform queries on your custom reports, or automatically integrate them into your own analytics or visualization tools.
Compatible with Similarweb Batch API only
To enable access to the Similarweb Snowflake connector, please speak to a Similarweb representative.
Snowflake integration instructions
The screenshots below are taken from Snowflake's latest user interface (UI), Snowsight. If you are using a different version of the UI, your account might look different.
Step 1
Retrieve your Snowflake locator ID. This can be found on the platformâs left sidebar.
Note: Your reports can only be shared to 1 Snowflake ID.
Step 2
Retrieve your Snowflake region using the following request:
select current_region()
Note: we support all snowflake regions.
Step 3
Once you have your Snowflake locator ID and region, use them to set up the integration via a POST request:
URL
https://api.similarweb.com/v3/batch/setup-snowflake
Header
api-key: {{your_batch_API_key}}
Body
{
"snowflake_account_idâ: "LOCATOR_ID",
âsnowflake_regionâ: âSNOWFLAKE_REGIONâ
}
Note: The name of this share will always be âSimilarweb{{yourlocator_id}}â. For example, "Similarweb_2341515"
Step 4
In your Snowflake account, ensure your role is set to Account Admin.
Step 5
Navigate to âDataâ > âShared Dataâ.
Locate the new share, and click âGet Dataâ.
*Note: you can still push data into Snowflake without approving the data share, however, it wonât be visible until approval.
Requesting reports: One-time reports
Step 1
When requesting a Similarweb Batch API report, state where youâd like the data to be delivered (using the Request Report endpoint). Input âdelivery_methodâ: âsnowflakeâ.
https://api.similarweb.com/v3/batch/request-report
Note: When the delivery method is set to âsnowflakeâ, the âresponse_formatâ field is not required.
You should receive âstatusâ: âpendingâ
Step 2
Use the request report status endpoint to verify the report is complete (âstatusâ: âcompletedâ). The table names will appear in the response (âsnowflake_tablesâ).
Step 3
In Snowflake, from your Worksheet, use the table name to see the report.
Each report requested will be viewable under Data > Databases
Requesting reports - Aggregated tables
To fully automate your analysis, you can request reports to be delivered to pre-defined tables within your Snowflake account. This will allow you to have fresh data sent directly to the same tables, rather than having a new table created each time you request a report. Configure your tables with Tableau, Looker, and other data visualization tools.
Step 1:
Define the table using the following POST request via the Batch API:
URL
https://api.similarweb.com/v3/batch/snowflake/define-table
Header
api-key: {your_batch_API_key}
Body
{
âtable_nameâ: âyour_table_name",
âgranularityâ: âmonthlyâ
âmetricsâ: [âdesktop_visitsâ, âtotal_bounce_rateâ, âtotal_average_visit_durationâ]
}
Note: Tables can only include metrics that below to the same âmetric groupâ. Metric groups can be found in the supported metrics tables in the documentation.
Step 2:
Include the table name when using the request-report endpoint. Input:
âdelivery_method_paramsâ: {
âtable_nameâ: âyour_table_nameâ
}
Note: when using the request-report endpoint to add data to an aggregated table, there is no need to redefine the metrics or granularity.
Once the data is ready, it will be available in your Snowflake table:
In aggregated table reports, a column named "created_date" is provided. These values are for your reference and do not cost any data points.
Need help?
For technical assistance, please reach out to your Similarweb Account Manager.
Updated 19 days ago