Authentication
Authenticating Requests
AgPowered Services APIs authenticate requests using a simple API key. Include your API key on every
request with the Api-Key header:
Api-Key: YOUR_API_KEY
Your API key is provided to you as part of onboarding. Treat it as a secret — do not commit it to source control or expose it in client-side code.
Here is how you would include the header in a request:
- cURL
- Python
- JavaScript
const axios = require('axios')
const endpoint = 'YOUR_API_ENDPOINT'
const headers = { 'Api-Key': 'YOUR_API_KEY' }
axios.get(endpoint, { headers })
.then(res => console.log(res.data))
.catch(console.error)
import requests
endpoint = 'YOUR_API_ENDPOINT'
headers = { 'Api-Key': 'YOUR_API_KEY' }
response = requests.get(endpoint, headers=headers)
print(response.json())
curl --location 'YOUR_API_ENDPOINT' \
--header 'Api-Key: YOUR_API_KEY'