API Authentication
Understand how to authenticate your API requests using your API key.
3 min read
Last updated: 2025-06-13
Authentication Methods
MetalAPI supports two authentication methods: Query parameter and Bearer token.
Query Parameter Method
Pass your API key as a query parameter:
GET https://metalapi.com/api/v1/latest?api_key=YOUR_API_KEY
Bearer Token Method
Pass your API key in the Authorization header:
curl -X GET "https://metalapi.com/api/v1/latest" \
-H "Authorization: Bearer YOUR_API_KEY"
Security Best Practices
• Never expose your API key in client-side code
• Use environment variables to store your API key
• Regenerate your API key if it's compromised
• Use HTTPS for all API requests
• Use environment variables to store your API key
• Regenerate your API key if it's compromised
• Use HTTPS for all API requests