---
name: statcan-wds-ingestion
description: "How to get Statistics Canada Web Data Service data into a pandas DataFrame and Parquet: access, the request, the format, limits, quirks and terms."
---

# Load Statistics Canada vector observations into pandas and Parquet

Source entry: https://signal-lab-jet.vercel.app/datasets/statcan-wds
Provider: https://www.statcan.gc.ca/en/developers/wds/user-guide
Checked against the provider's documentation: 2026-11-04

## Access
- No account or key. POST vector IDs and latestN values to the WDS method.
- Use full-table or delta files for large updates.

## Request
```bash
curl -X POST -H 'Content-Type: application/json' -d '[{"vectorId":1,"latestN":3}]' 'https://www150.statcan.gc.ca/t1/wds/rest/getDataFromVectorsAndLatestNPeriods'
```

## Format
JSON response with request status, series identifiers and observations carrying periods, value, decimals, scalar, status, release time and frequency.

## Load into pandas and Parquet
Needs Python 3 with requests, pandas and pyarrow.
```python
"""Statistics Canada WDS vector observations -> pandas -> Parquet. No key."""
import requests
import pandas as pd

URL = "https://www150.statcan.gc.ca/t1/wds/rest/getDataFromVectorsAndLatestNPeriods"
r = requests.post(URL, json=[{"vectorId": 1, "latestN": 3}], timeout=60)
r.raise_for_status()
item = r.json()[0]
obj = item["object"]
df = pd.DataFrame(obj["vectorDataPoint"])
df.insert(0, "vectorId", obj["vectorId"])
df.insert(1, "productId", obj["productId"])
df.to_parquet("statcan_vector_1.parquet", index=False)
print(len(df), "observations for vector", obj["vectorId"], "status", item["status"], "latest release", df["releaseTime"].max())
```
Run by us on 2026-11-04 (python 3.13.5 | pandas 3.1.0 | pyarrow 26.0.0 | requests 2.34.2). Result: 3 observations for vector 1 status SUCCESS latest release 2026-09-23T08:30

## Limits
- 25 requests per second per IP; 50 requests per second server-wide.
- Some methods return 409 during overnight updates.

## Quirks
- Apply scalar codes and retain decimal, status and frequency codes.
- Keep PID/coordinate or vector ID.
- Retain releaseTime for revisions.

## Terms and attribution
- The Open Licence allows commercial and non-commercial reuse.
- Acknowledge Statistics Canada and the product used.
- Terms page: https://www.statcan.gc.ca/en/terms-conditions/open-licence

## Sources
- https://www.statcan.gc.ca/en/developers/wds/user-guide: "Server limits of 50 requests per second with a individual IP address limit of 25 requests per second."
- https://www.statcan.gc.ca/en/terms-conditions/open-licence: "Statistics Canada grants you a worldwide, royalty-free, non-exclusive licence"

## Help improve this skill
Missing a source, or see something to improve? Call the MCP tool suggest_source or feedback (or POST /api/suggest or /api/feedback). Reviewed ideas: https://signal-lab-jet.vercel.app/agent-suggestions

Information for educational purposes only. Free tiers, limits and licenses belong to the providers and may change; check the provider's own terms before using the data.
