Skip to content

Instantly share code, notes, and snippets.

@idcesares
Last active April 23, 2021 19:51
Show Gist options
  • Select an option

  • Save idcesares/d269b204d4f2cf9c1f847ef0417502b4 to your computer and use it in GitHub Desktop.

Select an option

Save idcesares/d269b204d4f2cf9c1f847ef0417502b4 to your computer and use it in GitHub Desktop.
How to easily consume an Public API in Python and convert the result into a Pandas Dataframe
# Basic libraries
import requests
import pandas as pd
import json
# Define API URL
url = 'API_link'
# Consume API
response = requests.get(url).json()
# Convert from Dictionary to Pandas Dataframe
df = pd.DataFrame.from_dict(response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment