API Authentication & Interactive Docs
Getting Your API Key
All SkyWatch API requests require authentication using an API key passed in the x-api-key header.
Obtaining an API Key
- Log in to your SkyWatch Hub account
- Navigate to your account settings
- Copy your API key
- Keep this key secure - it provides access to your account and billing
Important
Never commit your API key to version control or share it publicly. Treat it like a password.
Using the Interactive API Documentation
This documentation site includes interactive API reference pages that let you test endpoints directly from your browser.
Setting Up Authorization
- Navigate to any API endpoint in the REST API Reference section
- Click the "Authorize" button
- Enter your API key in the Api key field in the section on the right
- Congifure your payload and click "Send API Request"
- View the response below the button
Your API key will be saved in your browser's local storage and automatically included in all requests.
Troubleshooting Interactive Features
If you encounter issues:
-
Check Browser Console (F12 → Console tab):
- Look for errors or network issues
-
Verify Authorization:
- Ensure you've entered your API key
- Check that your API key is valid and active
-
Clear Browser Cache:
- Hard refresh:
Cmd+Shift+R(Mac) orCtrl+Shift+F5(Windows) - Clear localStorage: Console →
localStorage.clear()
- Hard refresh:
-
Use Command Line Tools:
- If interactive features aren't working, use curl or other API clients (examples below)
Manual Authentication
If you prefer to use API keys programmatically, include the x-api-key header in all requests:
- curl
- Python
- JavaScript
curl https://api.skywatch.co/earthcache/accounts/users/me \
-H "x-api-key: YOUR_API_KEY_HERE"
import requests
headers = {"x-api-key": "YOUR_API_KEY_HERE"}
response = requests.get(
"https://api.skywatch.co/earthcache/accounts/users/me",
headers=headers
)
print(response.json())
const headers = {"x-api-key": "YOUR_API_KEY_HERE"};
const response = await fetch(
"https://api.skywatch.co/earthcache/accounts/users/me",
{ headers }
);
console.log(await response.json());
Testing Your Authentication
The quickest way to verify your API key works:
- Go to List Orders in the REST API Reference
- Enter your API key in the example section
- Click "Send API Request"
- You should see a 200 response with your orders
If you receive a 401 or 403 error, check that:
- Your API key is correct (no extra spaces)
- Your account is active
- You have the necessary permissions for the endpoint
Next Steps
- Explore the REST API Reference with your API key
- Follow workflow guides to learn common API patterns
- Review Best Practices for API usage