From Scraper to Warehouse: Delivering Web Data to Snowflake, BigQuery and S3 in Your Own Schema
To scrape data to Snowflake, BigQuery or S3 you need more than a scraper that works. You need the last mile: files that land complete, loads that can be re-run without duplicates, and tables that match your schema instead of the website's. Most guides stop at "export to CSV". These notes start there, with the file layout, the metadata, and the SQL for each destination.
To get scraped data into a data warehouse: write each run as Parquet files to object storage under a source=/dt=/run= path, add seven metadata columns to every row, mark the run complete with a manifest, load it into a staging table, then MERGE into your serving table on a stable key. That makes every load repeatable.
Last updated 7 December 2026. SQL tested for syntax against current Snowflake and BigQuery documentation.
How does scraped data get to a data warehouse?
Scraped data reaches a data warehouse in five stages across three zones, and the split between zones is where most delivery problems start. The scraper and the checks belong to whoever collects the data. The serving tables belong to you. The landing zone in the middle is the hand-off, and it needs a contract.
The delivery pipeline, by zone
Who owns what, and where the hand-off sits.
Two rules hold for every destination below. Never load straight into a table people query; always go through staging. And never let a load depend on having run exactly once, because one day it will run twice.
The delivery contract: seven columns and a path
A web scraping data pipeline to S3 or any warehouse stands or falls on two small things: the columns added to every row, and the way files are named. Get these right and the SQL later is short.
| Column | Example | What it lets you do |
|---|---|---|
| source | retailer-b | Partition, filter and reconcile per site |
| record_key | TRK-88213 | The stable ID you MERGE on. Agree it per source before the first run |
| source_url | https://…/p/88213 | Trace any value back to the page it came from |
| scraped_at | 2026-12-07T06:02:11Z | Know how old a value is. Always UTC |
| run_id | 2026-12-07T06 | Load, re-load or delete exactly one run |
| record_hash | 9f2c…e1 | Detect real changes without comparing every column |
| schema_version | 3 | Survive a new field without breaking the load |
The path does the rest. Use Hive-style key=value segments, because Snowflake, BigQuery, Athena and Spark all understand them as partitions.
Anatomy of a landing path
Each segment answers one question a loader will ask.
s3://acme-webdataBucket you own; the collector gets write access to one prefixlandingZone. Nothing here is queried directlysource=retailer-bOne folder per sitedt=2026-12-07Scrape date, UTC. The partition keyrun=06Lets you land several runs a daypart-0000.parquetData files, plus _manifest.json written last{
"run_id": "2026-12-07T06",
"source": "retailer-b",
"schema_version": 3,
"files": [{"name": "part-0000.parquet", "rows": 10135, "sha256": "4be1…"}],
"rows_total": 10135,
"rows_quarantined": 61,
"completed_at": "2026-12-07T06:11:48Z"
}Which web scraping data delivery format should you use?
Web scraping data delivery formats come down to three realistic choices. Pick by who reads the file, not by what the scraper happens to emit.
| Format | Types kept? | Nested fields? | Use it when | Avoid it when |
|---|---|---|---|---|
| Parquet | Yes, in the file | Yes | Loading a warehouse or a lake. The default | A person needs to open it in a spreadsheet |
| JSON Lines | Partly: numbers and strings only | Yes | The schema is still moving, or rows are deeply nested | Volumes are large; it is verbose and slow to scan |
| CSV | No: everything is text | No | A human or a legacy tool is the consumer | Fields contain commas, quotes, newlines or leading zeros |
CSV is where scraped data quietly goes wrong. A SKU of 00417 becomes 417. A price of "1,299.00" becomes two columns. A product description with a line break becomes two rows. Parquet carries the type with the value, so none of that can happen. Compress with Snappy or ZSTD, and batch files to roughly 100 to 250 MB compressed where the volume allows, which is the size Snowflake's loading guidance recommends.
How to scrape data to Snowflake
To scrape data to Snowflake, land the files in cloud storage, point an external stage at them, COPY into staging and MERGE into your serving table. Four steps, and each can be re-run.
-- 1. One stage over the landing zone (the storage integration is created once) CREATE STAGE IF NOT EXISTS raw.web_stage URL = 's3://acme-webdata/landing/' STORAGE_INTEGRATION = webdata_int FILE_FORMAT = (TYPE = PARQUET); -- 2. Load one run. COPY remembers which files it has loaded and skips them. COPY INTO staging.products FROM @raw.web_stage/source=retailer-b/dt=2026-12-07/run=06/ PATTERN = '.*[.]parquet' MATCH_BY_COLUMN_NAME = CASE_INSENSITIVE; -- 3. Upsert into the table people query MERGE INTO analytics.products_latest t USING ( SELECT * FROM staging.products WHERE run_id = '2026-12-07T06' QUALIFY ROW_NUMBER() OVER ( PARTITION BY source, record_key ORDER BY scraped_at DESC) = 1 ) s ON t.source = s.source AND t.record_key = s.record_key WHEN MATCHED AND s.scraped_at > t.scraped_at AND t.record_hash <> s.record_hash THEN UPDATE SET price = s.price, in_stock = s.in_stock, scraped_at = s.scraped_at, record_hash = s.record_hash, run_id = s.run_id WHEN NOT MATCHED THEN INSERT (source, record_key, price, in_stock, scraped_at, record_hash, run_id) VALUES (s.source, s.record_key, s.price, s.in_stock, s.scraped_at, s.record_hash, s.run_id);
QUALIFY line keeps the newest row per key, so a duplicate in the delivery can't break the load.For data that should arrive within minutes, replace step 2 with Snowpipe, which loads each file as it lands. The staging and MERGE steps stay the same. Use MATCH_BY_COLUMN_NAME either way: when a new field appears in the files, existing columns still line up and the load keeps working.
Web scraping to BigQuery
Web scraping to BigQuery follows the same shape with different verbs: files in Cloud Storage, a batch load into a run-scoped staging table, then MERGE. Batch loads are atomic and, per Google's documentation, carry no load charge on the shared slot pool, so staging costs you storage only.
-- 1. Replace the staging table with exactly one run. Safe to repeat. LOAD DATA OVERWRITE staging.products_run FROM FILES ( format = 'PARQUET', uris = ['gs://acme-webdata/landing/source=retailer-b/dt=2026-12-07/run=06/*.parquet'] ); -- 2. Upsert into the table people query MERGE analytics.products_latest t USING ( SELECT * FROM staging.products_run WHERE TRUE QUALIFY ROW_NUMBER() OVER ( PARTITION BY source, record_key ORDER BY scraped_at DESC) = 1 ) s ON t.source = s.source AND t.record_key = s.record_key WHEN MATCHED AND s.scraped_at > t.scraped_at AND t.record_hash != s.record_hash THEN UPDATE SET price = s.price, in_stock = s.in_stock, scraped_at = s.scraped_at, record_hash = s.record_hash, run_id = s.run_id WHEN NOT MATCHED THEN INSERT ROW; -- 3. Keep history, once per run DELETE FROM analytics.products_history WHERE run_id = '2026-12-07T06'; INSERT INTO analytics.products_history SELECT * FROM staging.products_run;
LOAD DATA INTO appends, so running it twice doubles the run. OVERWRITE on a run-scoped staging table, and delete-then-insert on history, make the whole script safe to repeat.Partition the history table by DATE(scraped_at) and cluster it by source, record_key. Queries for "the price of this product over time" then scan a sliver of the table instead of all of it.
Building a web scraping data pipeline to S3
A web scraping data pipeline to S3 is the simplest of the three to write to and the easiest to get subtly wrong, because S3 will accept anything. There's no schema to reject a bad file and no transaction to hide a half-written run. The path and the manifest from earlier are the discipline.
-- A table over the landing zone. No data is copied. CREATE EXTERNAL TABLE webdata.products ( record_key string, price decimal(12,2), in_stock boolean, source_url string, scraped_at timestamp, run_id string, record_hash string, schema_version int ) PARTITIONED BY (source string, dt date, run string) STORED AS PARQUET LOCATION 's3://acme-webdata/landing/'; -- After each run lands, register its partition ALTER TABLE webdata.products ADD IF NOT EXISTS PARTITION (source = 'retailer-b', dt = DATE '2026-12-07', run = '06');
Give the collector an IAM role that can write to landing/ and nothing else, and set a lifecycle rule to move raw files to cheaper storage after 90 days. If you need updates and deletes inside the lake itself, add a table format such as Iceberg or Delta on top; plain S3 is append-only in practice.
Snowflake, BigQuery and S3 side by side
| Snowflake | BigQuery | S3 data lake | |
|---|---|---|---|
| Files land in | S3, GCS or Azure, via an external stage | Cloud Storage | S3 itself |
| Batch load | COPY INTO | LOAD DATA | None needed; register the partition |
| Near real time | Snowpipe | Storage Write API | S3 event notifications |
| Upsert | MERGE | MERGE | Needs Iceberg or Delta |
| Re-run safety | COPY skips files already loaded | OVERWRITE a run-scoped table | Overwrite the run prefix |
| Access to grant | A role on one schema, key-pair login | A service account on one dataset | An IAM role on one prefix |
Scraped data to a data warehouse: append or upsert?
Scraped data in a data warehouse needs two tables, not one, because people ask two different questions of it. "What is the price now?" wants one row per product. "How has the price moved?" wants every observation. Trying to answer both from one table is why so many scraped datasets are either huge and slow or missing their history.
One staging table feeds two serving tables
Same rows, two shapes.
products_history append · one row per observation
| record_key | price | scraped_at |
|---|---|---|
| TRK-88213 | 149.00 | 12-05 06:02 |
| TRK-88213 | 149.00 | 12-06 06:01 |
| TRK-88213 | 129.90 | 12-07 06:02 |
| RD-2210 | 89.00 | 12-06 06:01 |
| RD-2210 | 89.00 | 12-07 06:02 |
Grows every run. Partition by date. Answers "how did it change?"
per key
products_latest upsert · one row per product
| record_key | price | scraped_at |
|---|---|---|
| TRK-88213 | 129.90 | 12-07 06:02 |
| RD-2210 | 89.00 | 12-07 06:02 |
Stays the size of the catalogue. Answers "what is it now?"
What breaks when loading scraped data, and the guard for each
Loading scraped data fails in a small number of repeatable ways. Each has a guard that costs a line or two.
| What goes wrong | What you see | The guard |
|---|---|---|
| A loader reads a half-written run | Row counts that change if you query again | Trigger on the manifest, never on the first file |
| A load runs twice | Duplicates in history, inflated counts | Run-scoped staging, MERGE on key, delete-then-insert by run_id |
| The site adds or renames a field | A failed load, or a silently null column | schema_version, additive-only changes, match columns by name |
| Types drift in text formats | "1,299.00" as a string, dates in two formats | Typed Parquet, UTC timestamps, decimals for money |
| A re-scrape of last Tuesday arrives today | History out of order, latest overwritten by old data | Partition by scrape date; in MERGE, update only when scraped_at is newer |
| Thousands of tiny files | Slow loads and slow queries | Batch to roughly 100–250 MB compressed where volume allows |
The checks that should run before anything lands at all are a separate subject; how to clean and normalize scraped data covers the main ones.
How to verify a load
Verifying a web scraping data pipeline means one comparison after every run: rows in the manifest against rows in staging against rows merged. If the three don't reconcile, stop and look before anyone queries the table.
| Run | Source | Landed | Loaded | New | Changed | Scrape → queryable | Status |
|---|---|---|---|---|---|---|---|
| 12-07T06 | retailer-b | 10,135 | 10,135 | 212 | 1,904 | 14 min | Reconciled |
| 12-07T06 | marketplace-a | 48,260 | 48,260 | 1,077 | 9,412 | 19 min | Reconciled |
| 12-07T06 | listings-c | 6,804 | 6,790 | 88 | 640 | — | 14 short · held |
| 12-06T06 | retailer-b | 10,102 | 10,102 | 35 | 1,611 | 13 min | Reconciled |
Delivery spec builder
Choose where scraped data should land and how you want it shaped. The builder writes a one-page delivery spec you can hand to any collector, in-house or external, covering the path, the format, the tables and the load.
Access: the least a collector needs
Scraped data delivery should never require handing over an admin login. Each destination has a narrow grant that is enough.
- Snowflake. A service user with key-pair authentication and a role that can write to one landing schema. Or no Snowflake access at all: the collector writes to your bucket and your own stage and COPY do the rest.
- BigQuery. A service account with object-create rights on one bucket prefix, and at most data-editor on one staging dataset.
- S3. A cross-account IAM role with an external ID, limited to
PutObjectonlanding/*. No list, no delete, no read of anything else.
The safest pattern is the same everywhere: the collector can write files into one place and can see nothing. Everything after the hand-off runs under your own credentials. Who keeps the code and the data if the relationship ends is a contract question worth settling before the first run.
How DataDwip delivers scraped data to your warehouse
Scraped data from us lands where your team already works, in the shape described above.
- Into your storage or warehouse, not a portal: Snowflake, BigQuery, S3, or another destination you name.
- In your schema. Field names, types and keys are agreed before the first run and versioned after it.
- Validated before it lands, with a quality report on each delivery.
- On a schedule you can hold us to. For dedicated data acquisition teams the SLA commits to 95% of deliveries on time and 30 days' notice of schema changes.
One-off datasets come through our web scraping services in the same formats. Ask for a free sample and try the load before you commit to anything.
Pre-flight checklist
Eight things to have in writing before the first production load.
- The record key for every source
- The seven metadata columns on every row
- Path layout: source, date, run
- Format and compression
- A manifest, written last, with row counts
- Staging first; MERGE into serving
- History and latest as separate tables
- Write-only access to one landing location
Frequently asked questions
How do I load scraped data into Snowflake?
Write each run as Parquet to cloud storage, create an external stage over that location, run COPY INTO a staging table, then MERGE into your serving table on a stable key. COPY skips files it has already loaded, so the load can be repeated safely. Use Snowpipe if data must arrive within minutes.
How do I send web scraping data to BigQuery?
Land Parquet files in Cloud Storage, use LOAD DATA OVERWRITE to load one run into a staging table, then MERGE into the serving table. Batch loads are atomic and have no load charge on the shared slot pool. Partition history by scrape date and cluster by source and key.
What is the best file format for scraped data?
Parquet for anything loaded into a warehouse or lake, because it keeps data types, supports nested fields and compresses well. Use JSON Lines while the schema is still changing, and CSV only when a person or a legacy tool has to open the file.
How should scraped data be organised in S3?
Use Hive-style partitions such as landing/source=retailer-b/dt=2026-12-07/run=06/, with Parquet data files and a manifest written last. Loaders should trigger on the manifest so they never read a partial run, and the collector should have write-only access to that prefix.
How do you avoid duplicates when loading scraped data?
Give every row a stable record key and a run ID. Load each run into staging on its own, MERGE into the latest table on the key, and for history delete the run's rows before inserting them. The load can then run twice with the same result.
Should scraped data be stored as snapshots or upserts?
Both. Keep an append-only history table with every observation, partitioned by date, and an upserted latest table with one row per record. History answers how values changed and cannot be rebuilt later; latest answers what the value is now.