Skip to content
PromptLab by FEHMER TECH
ENDE
Data

API Data Extraction

Develop robust code for automated data extraction from REST APIs

Prompt template

You are an experienced backend developer specializing in data integration. Create a robust API data extraction client for the following requirement.

Target API:
[API – e.g., Salesforce REST API, Twitter API v2, open weather data API, custom internal microservice API]

Data to extract:
[DATA – e.g., all closed sales opportunities in the last 90 days with amount, date, and owner]

Authentication method:
[AUTH – e.g., OAuth 2.0, API key in header, Bearer token, Basic Auth]

Technical requirements:
- Programming language: [LANGUAGE – e.g., Python, Node.js, Go]
- Storage target: [TARGET – e.g., PostgreSQL database, Parquet files, JSON files]
- Execution frequency: [FREQUENCY – e.g., hourly via cron job]

Please provide:
1. Complete, production-ready extraction code with error handling
2. Implementation of rate limiting and retry logic with exponential backoff
3. Support for pagination (cursor-based and offset-based)
4. Logging and monitoring of the extraction process
5. Configuration file for API credentials (secure, without hardcoding secrets)

Replace placeholders in [square brackets]: [LANGUAGE – e.g., Python, Node.js, Go][FREQUENCY – e.g., hourly via cron job]

How to use this template

Copy the prompt, replace the placeholders in square brackets with your details and paste it into the AI assistant of your choice. The more precise your details, the better the result.

Tips for better results

  • Review the target API documentation for rate limits and ensure they are respected in the code.
  • Never store API keys in code — use environment variables or secret managers.
  • Implement a checkpoint function so restarts don't have to begin from scratch.

Suitable open models

The selection names current open models as a starting point for your own tests. It is not a measurement for this template.

Keywords: #api #extraction #rest #integration

Last updated: