GCS Table Integration
This guide provides a step-by-step walkthrough for using Similarweb’s Batch API to create a GCS integration, manage tables, and efficiently extract data.
1
Create a new Google Cloud connection
Start by creating a new GCS integration to store and access data. This setup will generate GCS access and secret keys that allow you to interact with your data securely in the specified bucket.
--url https://api.similarweb.com/v4/batch/gcs-connector/setup \2
Save your credentials
After creating the connection, we’ll provide you with private credentials, including access keys. These keys are essential to access the share bucket securely. Make sure to store them in a safe place.
"expiration_date": "2025-09-21", "gcs_bucket": "sw-daas-production", "gcs_prefix": "account_id/my_integration/", "integration_name": "my_integration", "secret": { "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "GCP_CLIENT_EMAIL", "client_id": "GCP_CLIENT_ID", "client_x509_cert_url": "GCP_CLIENT_X509_CERT_URL", "private_key": "GCP_PRIVATE_KEY", "private_key_id": "GCP_KEY_ID", "project_id": "GCP_PROJECT_ID", "token_uri": "https://oauth2.googleapis.com/token", "type": "service_account", "universe_domain": "googleapis.com"3
Generate a report using 'create table' url
Creating a table is similar to requesting a one-time report, but this time, you will modify the delivery information and use the create-table URL. This step allows you to set up a table to store data continuously.
--url https://api.similarweb.com/batch/v5/integration/create-table \4
Modify delivery information
Adjust the delivery_information section to define where and how the data will be delivered. In this case, set the delivery method to google_bucket_access to store the data in your google_bucket_access.
"delivery_method": "google_bucket_access",5
Specify the integration name
The integration_name parameter should always be set to gcs_default to direct data to the appropriate integration.
"integration_name": "gcs_default",6
Name your table
Provide a unique name for your table. This name will be used to identify and manage the table in your google bucket. Choose a meaningful name that corresponds to the data you will store.
"table_name": "test"7
Run the request
Once you have filled out the request body, submit the request to create the table. After submitting, the table will be set up in your google bucket, and the requested data will be added to it.
8
Retrieve the table path
Upon successful creation of the table, you will receive a location that represents the path where the table data is stored. This path is used to access the stored data.
"location": "gs://sw-daas-production/account_id/my_integration/test",9
Add data to the table
To add more data to the table after it has been created, use the request report URL. This step allows you to append new data to the table.
--url https://api.similarweb.com/batch/v5/request-report \10
Send data to the table
By specifying the integration name and table name, you can add new data to your existing table. This allows you to keep your data up-to-date with additional information as needed.
"response_format": "csv", "delivery_method": "google_bucket_access", "delivery_method_params": { "integration_name": "gcs_default", "table_name": "test"11
Note
"response_format": "csv", "delivery_method": "google_bucket_access" "integration_name": "gcs_default", "table_name": "test" Must be the same as when you created the table
{"success":true}On this page
- GCS Table Integration