Documentation
Authentication
All requests to the CurrencyApi.net API require authentication using your API key. Your API key acts as your unique identifier and determines your access level and rate limits.
If you don't have an API key yet, you can get one by visiting our pricing page or accessing your dashboard if you already have an account.
API Keys
Our API keys are unique 36-character strings. Depending on your plan, you may have multiple API keys.
An API key should be included in every API request you make. Keep it secure and never share it publicly or commit it to version control.
- Keep it secure: Never expose any of your API keys in client-side code or public repositories
- Include in every request: All API endpoints require your API key
- Can be regenerated: If compromised, you can generate a new key from the Dashboard
Authentication Methods
There are two ways to include your API key in requests:
- Query Parameter: Add
?key=YOUR_API_KEY
to the URL (most common) - SDK: Our SDKs handle authentication automatically when you initialize them with your key
Making Authenticated Requests
To authenticate your requests, include your API key as a query parameter. Here's an example using the Currency Rates endpoint
Troubleshooting
If you encounter authentication errors, here are the most common issues and their solutions:
- Missing API Key: Ensure you're including the
key
parameter in your request - Invalid API Key: Verify your API key is correct and hasn't been regenerated
- Expired Plan: Check that your subscription plan is active and hasn't expired
When authentication fails, you'll receive an error response with a 400 HTTP response code.
For more information, see the Error Codes page.
Best Practices
Follow these best practices to keep your API key secure and your requests working smoothly:
- Environment Variables: Store your API key in environment variables, not in your code
- Server-Side Only: Only use API keys in server-side applications, never in client-side code
- Regular Rotation: Consider regenerating your API key periodically for security
- Monitor Usage: Keep track of your API usage to avoid hitting rate limits
- Use HTTPS: Always make requests over HTTPS to protect your API key in transit
Next Steps
Now that you understand authentication, you're ready to explore our API endpoints:
- Choose your integration method: Decide whether to use our SDK documentation for easier development or make direct API calls
- Try the Currency Rates endpoint: Use the Currency Rates endpoint to get real-time exchange rates for all supported currencies
- Explore Currency Conversion: Convert specific amounts between currencies using the Currency Conversion endpoint