I am new to APIs and am having problems in accessing data from catalog.data.gov. I have successfully used the below code to search my dataset of interest, but can't figure out how I can fetch the data for the collection "Monthly Traffic Volume Trends". I am interested in getting all the 154 datasets in this collection. Please guide me through this

import urllib3
from urllib.parse import quote
import json
import pprint

# Make the HTTP request.
http = urllib3.PoolManager()
response = http.request('GET','http://catalog.data.gov/api/3/search/dataset?q="monthly_traffic_volume_trends_may_2002"&rows=10')
# Use the json module to load CKAN's response into a dictionary.
response_dict = json.loads(response.data)
# Check the contents of the response.
result = response_dict['results']
  • for the record, a query that returns search results: https://catalog.data.gov/api/3/search/dataset?q=%22monthly%20traffic%22&rows=100 – philshem Jul 24 '20 at 6:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.