Authentication
All Long.xyz APIs require authentication via API key and are protected by rate limiting and CORS policies.API Key Authentication
Every API request must include your API key in theX-API-KEY header:
Security & Access Control
Rate Limiting
Our APIs implement fair usage rate limiting to ensure service quality for all users. If you exceed the rate limit, you’ll receive a429 Too Many Requests response.
CORS Protection
All API endpoints are protected by CORS (Cross-Origin Resource Sharing) policies. Server-Side Usage (No CORS Issues):- Server-to-server requests (backend APIs, cron jobs, etc.)
- Server-Side Rendering (SSR) - Next.js, Nuxt, SvelteKit, etc.
- Node.js scripts and services
- Browser-based requests (Single Page Applications)
- Any scenario where the API key is visible in browser Network tab
Getting Access
To consume Long.xyz APIs, you must:- Obtain an API Key - Contact the Long.xyz team to request your API key
- Whitelist Your Domains (if needed) - Required only for client-side/browser requests. Provide the domains that will make API requests for CORS configuration
Contact Long.xyz support to set up your API access and domain whitelist.
Best Practices
- Store your API key securely (use environment variables)
- Never expose your API key in client-side code or public repositories
- Implement proper error handling for rate limit responses
- Consider implementing request caching to minimize API calls