TGViewer
Data science/ML/AI Data science/ML/AI @datascience_bds · 14K subscribers
Post #1044 1.45K
Importing API Data into a Pandas DataFrame

import requests            # Library for making HTTP requests
import pandas as pd        # Library for data manipulation and analysis

# API endpoint
url = "https://api.example.com/users"

# Send request to API
response = requests.get(url)

# Convert JSON response to Python object
data = response.json()

# Convert the JSON data into a pandas DataFrame
df = pd.DataFrame(data)

# Display the first five rows of the DataFrame
print(df.head())


Next up ➡️ API Key Authentication
  • ❤ 6
More from @datascience_bds
  1. Oct 13, 20261,000 AI/ML Acronyms & Operational Concepts
  2. Oct 12, 2026Roadmap to Learn SQL
  3. Oct 11, 2026🧮 Why does NumPy let you add a number to an entire matrix? Look at this: import numpy as…
  4. Oct 10, 2026document post
  5. Oct 9, 20268 RAG architectures for AI Engineers, visually explained:
  6. Oct 8, 2026document post
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →