0 votes
I want to access data from the Bristol API (open transport data).  How do I do this?
by

1 Answer

0 votes

Hi Nigel, 

For such custom data integration You can create a custom python recipe (with no input dataset  which structure would look like this 


import dataiku
import pandas as pd, numpy as np
import requests


api_key="YOUR_API_KEY"

response = requests.get('https://bristol.api.urbanthings.io/api/2.0/static/transit/stops',
                         headers={"X-Api-Key": api_key}
                         )
jsonResp = response.json()


output_dataframe = pd.DataFrame(jsonResp.get("data"))

py_recipe_output = dataiku.Dataset("outputDataset")

py_recipe_output.write_with_schema(output_dataframe)

You may have to ajust the code depending on what you want to do but dont hesitate to  check DSS API Documentation  especially if you choose to use a different language. 

by
1,250 questions
1,277 answers
1,450 comments
11,801 users

┬ęDataiku 2012-2018 - Privacy Policy