360 Secure SkillHub
360 安全技能中心

City of Vancouver Open Data

通过 Python 脚本调用 Opendatasoft API,提供 search、list、info、fetch 四个命令,可搜索温哥华开放数据门户的数据集、查看字段元数据、按条件筛选并取回数据行,支持以 JSON 或 CSV 输出。

raychanpmp
raychanpmp
热度 38.69
最近更新 2026-05-11 17:38:25
分类:数据依赖:代码执行 / 第三方 API应用场景:研究 / 数据处理 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add vancouver-opendata
Metadata
name
City of Vancouver Open Data
description
Access 194+ datasets from the City of Vancouver open data portal. Search, fetch, and analyze city data on parking, transit, permits, demographics, and more via the Opendatasoft API.
permissions
Bash
triggers
["vancouver open data","city of vancouver data","vancouver dataset","opendata.vancouver.ca","vancouver transit","vancouver permits"]

City of Vancouver Open Data

Access and analyze 194+ open datasets from the City of Vancouver via the Opendatasoft API. Data covers parking, transit, permits, demographics, environment, infrastructure, and more.

Portal: https://opendata.vancouver.ca Platform: Opendatasoft

Quick Start

# Search for datasets
python3 scripts/vancouver_data.py search "parking"

# List all datasets
python3 scripts/vancouver_data.py list

# View dataset info
python3 scripts/vancouver_data.py info parking-tickets-2017-2019

# Fetch data
python3 scripts/vancouver_data.py fetch parking-tickets-2017-2019 --limit 5

# Fetch with filters
python3 scripts/vancouver_data.py fetch parking-tickets-2017-2019 --where "year='2019'" --limit 10

# Export as CSV
python3 scripts/vancouver_data.py fetch parking-tickets-2017-2019 --limit 100 --csv > tickets.csv

Commands Reference

Command Description
search <query> Search datasets by keyword
list List all datasets
info <dataset-id> Show dataset metadata and fields
fetch <dataset-id> Fetch data rows (opts: --limit, --where, --select, --order, --csv)

Query Parameters

  • --limit N — Max rows to return (default: 10)
  • --where "condition" — SQL-like filter
  • --select "col1,col2" — Choose specific columns
  • --order "col DESC" — Sort results
  • --csv — Output as CSV instead of JSON

Dataset IDs

Dataset IDs are URL-safe slugs (e.g., parking-tickets-2017-2019). Find them via search or list, or from the dataset URL: opendata.vancouver.ca/explore/dataset/{id}.

Data Sources

All data is sourced from the City of Vancouver's Open Data Portal (opendata.vancouver.ca). See references/datasets.md for a curated list of popular datasets.