Usage and technical questions
How do I handle authentication and API key security?
Best Practices:
- Store API keys securely, ideally in environment variables or secure vaults.
- Regularly rotate your API keys.
- Avoid hardcoding API keys in your code, especially in public repositories.
- If you suspect your key is compromised, revoke it immediately and generate a new one.
How do I handle errors or troubleshoot issues with the Freepik API?
To handle errors and troubleshoot issues with the Freepik API, the documentation provides guidance on interpreting and resolving common errors:
- **401 Unauthorized**: Occurs when the API key is invalid or missing. Ensure your API key is included in the headers and is correctly formatted.
- **404 Not Found**: Indicates that the requested resource or endpoint does not exist. Double-check the URL and parameters.
- **429 Too Many Requests**: Triggered when the rate limit is exceeded. You'll need to wait until the limit resets before making more requests, upgrade your plan if you are a free user or request higher rate and budget limits contacting us at freepik.com/api#contact.
- **500 Internal Server Error**: A server-side error. If this happens, contact support.
Troubleshooting Tips:
- **Check the API Documentation**: Always refer to the documentation to ensure you're using the correct endpoints and parameters.
- **Review API Response Codes**: Pay attention to the HTTP status codes returned by the API.
- **Contact Support**: If you're unable to resolve an issue, reach out to our support team for assistance.
Can't find an answer to your question?