Snowflake (apify/snowflake)
Pricing
Pay per usage
Snowflake (apify/snowflake)
Imports any Apify dataset into a Snowflake table with append or create modes. Supports custom column mapping, automatic table creation with schema inference, batching, resumable imports, and programmatic access token (PAT) authentication. Works standalone or as an Actor-to-Actor integration.
Pricing
Pay per usage
Rating
0.0
(0)
Developer
Apify
Maintained by ApifyActor stats
0
Bookmarked
2
Total users
1
Monthly active users
13 days ago
Last modified
Categories
Features
Share
Import any Apify dataset into a Snowflake table and query scraped web data with SQL, dbt, or your BI tools. Start a run in Apify Console, or use the Snowflake integration to schedule recurring imports without code.
Main features
- Insert or create: write into an existing table, or create the table on the first run and append to it on every run after. Neither mode replaces existing data.
- Column mapping: choose which dataset fields to import and rename them to match your Snowflake columns.
- Exact names: by default, column and table names keep their case and special characters.
- Resumable imports: rows go in batches of 5,000, with progress saved after each batch. Restarts resume after the last saved batch. An interruption before that save can repeat a batch. A new run imports every row again, including rows written before a failure.
- Token authentication: connect with a Snowflake programmatic access token (PAT), stored as a secret input.
Use cases for Snowflake
- Competitor pricing: load prices from a scheduled e-commerce scraper and track them next to your sales data.
- Lead enrichment: add contact and company data from Apify Actors to your CRM tables.
- Sentiment analysis: import reviews and social posts for scoring models and brand monitoring.
How much does it cost?
See the Pricing tab for Apify costs. Snowflake bills the warehouse compute for each import separately.
Getting started
- In Snowflake, create a programmatic access token (PAT) and copy it. It's shown only once. By default, your Snowflake user also needs a network policy that allows Apify runs. A Snowflake admin may need to apply the network policy fix in Troubleshooting.
- Run the SQL snippet in Snowflake and copy the JSON it returns.
- In Apify Console, open the Input JSON tab and paste the JSON.
- Add the dataset, your login name, the PAT, and the table name, then choose an import mode.
- Start the run. When it finishes, the rows are in your Snowflake table.
Input
All fields below are required except snowflakeWarehouse, and importMode defaults to append.
See the Input tab for the rest, including Column mapping and Exact names.
| Field | Type | Description |
|---|---|---|
datasetId | string | The dataset to import, usually the default one from an Actor or task run. |
snowflakeAccount | string | Your account identifier in orgname-accountname format. |
snowflakeUsername | string | Your Snowflake login name. To find it, run DESCRIBE USER <user_name>; with the name from SELECT CURRENT_USER(); and copy LOGIN_NAME. |
snowflakePat | string | Your programmatic access token. |
snowflakeWarehouse | string | Leave empty to use your default warehouse. Required if you don't have one. |
importMode | string | append (Insert into existing table, default) writes into an existing table. create_new (Create new table) creates the table if it doesn't exist. |
destination | object | The target table as {database, schema, table}. |
Example input
This input creates a PRODUCT_PRICES table on the first run and imports two mapped fields:
{"datasetId": "YOUR_DATASET_ID","snowflakeAccount": "myorg-myaccount","snowflakeUsername": "YOUR_LOGIN_NAME","snowflakePat": "YOUR_PAT","importMode": "create_new","destination": {"database": "ANALYTICS","schema": "SCRAPED","table": "PRODUCT_PRICES"},"columnMapping": [{ "source": "title", "destination": "PRODUCT_TITLE" },{ "source": "price", "destination": "PRICE" }]}
Output
Your data lands in the Snowflake table you chose, with nested objects and arrays stored as JSON text. Each successful run also saves one item to its default dataset with the rows written, the run's ID, and the full table name. For the example input above, it looks like this:
{"rowsImported": 1250,"runId": "YOUR_RUN_ID","destination": "ANALYTICS.SCRAPED.PRODUCT_PRICES"}
With Create new table, column types come from the first batch of rows.
If a run fails, it saves nothing to its Apify dataset, but batches it already wrote stay in
Snowflake. The run's status message names the failed step. An input error names the field, a
connection error starts with Failed to connect to Snowflake:, and an import error starts with
Import failed:.
Run it after another Actor
On the other Actor's Integrations tab, add Snowflake Data Import, set it to start when the run
succeeds (the ACTOR.RUN.SUCCEEDED event), and set Dataset to {{resource.defaultDatasetId}}.
Each successful run then imports its own dataset.
Troubleshooting
Token rejected by network policy?
By default, Snowflake only accepts a PAT from a user covered by a network policy, and Apify runs don't connect from fixed IP addresses. A Snowflake admin can:
- Allow connections from any IP address in the user's network policy.
- If no network policy applies, attach an authentication policy with
PAT_POLICY = (NETWORK_POLICY_EVALUATION = ENFORCED_NOT_REQUIRED).
This setting still enforces any existing network policy.
Can't connect to Snowflake?
Check these:
- The account identifier uses
orgname-accountnameformat. - The username is your login name, which can differ from your user name.
- The PAT hasn't expired.
If Snowflake rejects the PAT, see the network policy fix.
Missing privileges?
The connecting user's role needs these grants:
USAGEon the warehouse, database, and schema.CREATE STAGEon the schema, for the temporary stage each import uses.INSERTon the table.- With Create new table, also
CREATE TABLEandCREATE FILE FORMATon the schema.
Table not found?
Insert into existing table needs a table that already exists. Create it in Snowflake first, or switch to Create new table.
With Exact names on, database, schema, and table names are case-sensitive. A table created
without quotes is stored in uppercase. Enter PRODUCT_PRICES, not product_prices. Run
SHOW TABLES IN SCHEMA <database>.<schema>; to check.
Mapped column is empty?
Its source field isn't in the dataset. The run still succeeds but writes empty values. Names are case-sensitive, and the run log lists the ones that didn't match.
Field missing from the table?
Without column mapping, the columns come from the first 5,000 rows. A field that first appears later isn't imported. With mapping set, only mapped fields are imported. List it under Column mapping with every other field you want.
Queries can't find your columns?
With Exact names on, names are case-sensitive. Lowercase and mixed-case fields, like title and
productName, need double quotes, like SELECT "title", "productName" FROM .... To query a new
table without quotes, map fields to uppercase names in Column mapping, or turn the setting off.
Neither option renames existing columns.
Need support or a custom feature?
If none of these fixes helps, open an issue on the Issues tab with your input and the run's status message. Remove the PAT first. For a different destination or behavior, ask Apify for a custom solution.
Fill in the input with SQL
The snippet fills in the first-run fields except datasetId, snowflakeUsername, snowflakePat,
importMode, and destination.table. Select your warehouse, database, and schema in the worksheet
first, or the snippet leaves them out.
SELECT OBJECT_CONSTRUCT('snowflakeAccount', CURRENT_ORGANIZATION_NAME() || '-' || CURRENT_ACCOUNT_NAME(),'snowflakeWarehouse', CURRENT_WAREHOUSE(),'destination', OBJECT_CONSTRUCT('database', CURRENT_DATABASE(),'schema', CURRENT_SCHEMA(),'table', '')) AS actor_input;