Fetch and Combine Data from Paginated API Endpoint
Beginner Mode
Start your terminal to use beginner mode.
Scenario
A product inventory API returns data in paginated format. You need to fetch all pages and combine them into a single dataset for analysis.
Task
Write a Python script at /home/interview/fetch_products.py that fetches all pages from the API at http://api.products.local/products, combines the data from all pages, and saves the complete dataset to /home/interview/products.csv.
Example
Expected output format in /home/interview/products.csv:
id,name,category,price,stock
1,Product Name,Electronics,299.99,50
2,Another Product,Home & Garden,49.99,120
...
Terminal requires a larger screen
Open this page on a desktop or tablet (≥ 768px) to launch the terminal and practice hands-on.
Linux Terminal Environment
Write and execute your solution in the terminal below.
Track
| Question | Difficulty | Company | Access |
|---|
Need more practice in this area? Explore more questions →
Salesforce