Skip to main content
Data engineering · Build notes

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.

DDDataDwip Team · Reviewed by the delivery engineers
Published 7 Dec 2026 12 min read
Quick answer

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.

Collector's side
01ScrapeFetch and parse into typed rows
02ValidateQuarantine bad rows before anything is written
Hand-off
03LandFiles plus a manifest in object storage
Your warehouse
04StageLoad the run as-is, one run at a time
05ServeMERGE into your tables, in your schema
Everything left of the hand-off can change without you noticing, as long as what lands keeps the same shape. That shape is the delivery contract.

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.

ColumnExampleWhat it lets you do
sourceretailer-bPartition, filter and reconcile per site
record_keyTRK-88213The stable ID you MERGE on. Agree it per source before the first run
source_urlhttps://…/p/88213Trace any value back to the page it came from
scraped_at2026-12-07T06:02:11ZKnow how old a value is. Always UTC
run_id2026-12-07T06Load, re-load or delete exactly one run
record_hash9f2c…e1Detect real changes without comparing every column
schema_version3Survive 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 prefix
/
landingZone. Nothing here is queried directly
/
source=retailer-bOne folder per site
/
dt=2026-12-07Scrape date, UTC. The partition key
/
run=06Lets you land several runs a day
/
part-0000.parquetData files, plus _manifest.json written last
The manifest is written only after every data file is in place. A loader that waits for it never reads half a run.
_MANIFEST.JSONWRITTEN 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.

FormatTypes kept?Nested fields?Use it whenAvoid it when
ParquetYes, in the fileYesLoading a warehouse or a lake. The defaultA person needs to open it in a spreadsheet
JSON LinesPartly: numbers and strings onlyYesThe schema is still moving, or rows are deeply nestedVolumes are large; it is verbose and slow to scan
CSVNo: everything is textNoA human or a legacy tool is the consumerFields 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.

StageExternal stage over the landing prefix
CopyCOPY INTO a staging table
MergeUpsert on source and record_key
VerifyCounts against the manifest
SNOWFLAKESQL
-- 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);
GotchaMERGE fails, or behaves unpredictably, if the source has two rows for one key. The 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.

LandParquet in a Cloud Storage bucket
LoadLOAD DATA OVERWRITE into staging
MergeUpsert, and append to history
VerifyCounts against the manifest
BIGQUERYSQL
-- 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;
GotchaA plain 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.

WriteData files to the run prefix
SealManifest written last
RegisterAdd the partition to your catalogue
ExpireLifecycle rules on old raw files
ATHENA · OVER THE S3 LANDING ZONESQL
-- 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');
GotchaS3 has no atomic rename. A reader that lists the prefix mid-upload sees half the files. Register the partition, or trigger the downstream load, from the manifest's arrival and never from the first data file.

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

SnowflakeBigQueryS3 data lake
Files land inS3, GCS or Azure, via an external stageCloud StorageS3 itself
Batch loadCOPY INTOLOAD DATANone needed; register the partition
Near real timeSnowpipeStorage Write APIS3 event notifications
UpsertMERGEMERGENeeds Iceberg or Delta
Re-run safetyCOPY skips files already loadedOVERWRITE a run-scoped tableOverwrite the run prefix
Access to grantA role on one schema, key-pair loginA service account on one datasetAn 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_keypricescraped_at
TRK-88213149.0012-05 06:02
TRK-88213149.0012-06 06:01
TRK-88213129.9012-07 06:02
RD-221089.0012-06 06:01
RD-221089.0012-07 06:02

Grows every run. Partition by date. Answers "how did it change?"

newest row
per key

products_latest upsert · one row per product

record_keypricescraped_at
TRK-88213129.9012-07 06:02
RD-221089.0012-07 06:02

Stays the size of the catalogue. Answers "what is it now?"

History is the table you can't rebuild later. If you keep only one, keep that one; latest can always be derived from it.

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 wrongWhat you seeThe guard
A loader reads a half-written runRow counts that change if you query againTrigger on the manifest, never on the first file
A load runs twiceDuplicates in history, inflated countsRun-scoped staging, MERGE on key, delete-then-insert by run_id
The site adds or renames a fieldA failed load, or a silently null columnschema_version, additive-only changes, match columns by name
Types drift in text formats"1,299.00" as a string, dates in two formatsTyped Parquet, UTC timestamps, decimals for money
A re-scrape of last Tuesday arrives todayHistory out of order, latest overwritten by old dataPartition by scrape date; in MERGE, update only when scraped_at is newer
Thousands of tiny filesSlow loads and slow queriesBatch 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.

Load monitorANALYTICS.PRODUCTS_LATEST · RUN 2026-12-07T06 · EXAMPLE
In the manifest
10,135
1 file · schema v3
=
Loaded to staging
10,135
0 rejected
=
Merged
10,135
212 new1,904 changed8,019 unchanged
RunSourceLandedLoadedNewChangedScrape → queryableStatus
12-07T06retailer-b10,13510,1352121,90414 minReconciled
12-07T06marketplace-a48,26048,2601,0779,41219 minReconciled
12-07T06listings-c6,8046,79088640—14 short · held
12-06T06retailer-b10,10210,102351,61113 minReconciled
An example load monitor. One run is 14 rows short of its manifest, so it is held in staging instead of merged. Illustrative figures, not a DataDwip product screen.

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.

Destination
File format
Tables you need
How often runs land
DELIVERY-SPEC.TXT

      

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 PutObject on landing/*. 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.

DD

DataDwip Team DataDwip runs web scraping and managed data acquisition for data-product companies in the US, UK and Europe: 1,000+ websites monitored, 50 million records delivered, 5.0 average rating across 38 verified reviews on Clutch and GoodFirms. Reviewed by the engineers who run our deliveries. About us.

Related reading