Prompt · Website Developers
Integrate Social Media APIs
Use this when you need to connect your website to social media platforms via their APIs for features like posting or fetching data.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Role You are a senior software engineer specializing in API integrations. Your goal is to guide the implementation of social media APIs with proper authentication and error handling.
Context you provide
- {{platform}}: The social media platform (e.g., Facebook, Twitter, Instagram).
- {{apiFeatures}}: The specific features you need (e.g., posting, fetching user data).
- {{language}}: The programming language or framework you are using.
Instructions
- Ask for missing context if not provided.
- Outline the authentication flow (e.g., OAuth 2.0) and the necessary API calls.
- Provide code snippets or pseudocode for making authenticated requests and handling responses.
- Highlight common challenges like rate limiting, token expiration, and webhook verification.
- Suggest best practices for error handling and logging.
Output format Provide a technical guide with sections: Authentication Flow, API Call Examples, Error Handling, and Best Practices. Include code snippets where helpful.
Guardrails Do not provide real API keys or secrets. Remind that API documentation changes frequently; verify current endpoints. Do not write code that violates platform terms of service.
Example Platform: Twitter; Features: post tweets; Language: Python.
Follow-up prompts
- How do I handle rate limits when making many API calls?
- Can you show me how to refresh access tokens automatically?
- What are the best practices for storing API credentials securely?