Documentation menu
Getting started
QuickstartEndpoints
GET/sourcesGET/tender/alerts/unsubscribeGET/vendorsGET/departmentsGET/expiringGET/tender/feedGET/tender/{record_id}/documents/{doc_index}GET/department/{name}GET/process/{process_key}GET/vendor/{name}GET/contractGET/tenderGET/awardGET/disclosureGET/standing_offerGET/pre_solicitationGET/contract/statsGET/tender/statsGET/award/statsGET/disclosure/statsGET/standing_offer/statsGET/pre_solicitation/statsGET/contract/coverageGET/tender/coverageGET/award/coverageGET/disclosure/coverageGET/standing_offer/coverageGET/pre_solicitation/coverageGET/procurement/{solicitation_number}GET/contract/{record_id}GET/tender/{record_id}GET/award/{record_id}GET/disclosure/{record_id}GET/standing_offer/{record_id}GET/pre_solicitation/{record_id}Docs / Guides / Export results to CSV or a spreadsheet
Export results to CSV or a spreadsheet
Pull records across pages and write them to a CSV you can open in Excel or Sheets.
Pull every matching record from ProcureData and write a CSV you can open in Excel or Google Sheets. This loops pages until the results run out.
import csv, requests
URL = "https://api.procuredata.ca/sources"
HEADERS = {"X-API-Key": "YOUR_API_KEY"}
rows, cursor = [], None
while True:
params = {"limit": 500}
if cursor:
params["cursor"] = cursor
r = requests.get(URL, headers=HEADERS, params=params).json()
rows += r.get("results", [])
cursor = r.get("next_cursor")
if not cursor:
break
with open("export.csv", "w", newline="") as f:
w = csv.DictWriter(f, fieldnames=rows[0].keys())
w.writeheader()
w.writerows(rows)Swap in the filters from the endpoint's reference page to export exactly the slice you want.
Ready to build?Create a free key and start calling ProcureData in minutes. No card required.
Get your API key →