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.