Build on OPYNX
Integrate music streaming, event ticketing, and fan engagement into your app with the OPYNX API.
Authentication
All API requests require a Bearer token. Include your API key in the Authorization header.
curl -X GET https://api.opynx.dev/v1/tracks \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json"
Note: Keep your API key secret. Never expose it in client-side code. Use environment variables or a server-side proxy.
Tracks API
/v1/tracksList all tracks. Supports pagination and filtering by genre, artist, or BPM.
Parameters: page, limit, genre, artist_id, bpm_min, bpm_max
curl https://api.opynx.dev/v1/tracks?genre=synthwave&limit=10 \ -H "Authorization: Bearer YOUR_API_KEY"
Response:
{
"data": [
{
"id": "trk_abc123",
"title": "Midnight Drive",
"artist": { "id": "art_xyz", "name": "NeonWave" },
"genre": "synthwave",
"bpm": 120,
"duration": 225,
"stream_url": "https://cdn.opynx.dev/stream/trk_abc123",
"created_at": "2025-12-01T00:00:00Z"
}
],
"meta": { "page": 1, "limit": 10, "total": 142 }
}/v1/tracksUpload a new track. Requires Creator role. Send as multipart/form-data.
Parameters: title (required), genre, bpm, file (audio, required)
curl -X POST https://api.opynx.dev/v1/tracks \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "title=Solar Flare" \ -F "genre=electronic" \ -F "bpm=128" \ -F "file=@track.mp3"
Events API
/v1/eventsList upcoming events. Filter by location, date range, or artist.
Parameters: page, limit, city, date_from, date_to, artist_id
curl https://api.opynx.dev/v1/events?city=los-angeles&limit=5 \ -H "Authorization: Bearer YOUR_API_KEY"
/v1/eventsCreate a new event. Requires Creator or Facilitator role.
Parameters: title (required), venue, date (required), capacity, tiers (array of ticket tiers)
curl -X POST https://api.opynx.dev/v1/events \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Neon Nights Vol. 3",
"venue": "The Echo, Los Angeles",
"date": "2026-05-15T20:00:00Z",
"capacity": 500,
"tiers": [
{ "name": "General", "price": 25.00, "quantity": 400 },
{ "name": "VIP", "price": 75.00, "quantity": 100 }
]
}'Tickets API
/v1/ticketsList tickets for the authenticated user, or for a specific event.
Parameters: event_id, status (active, used, transferred)
curl https://api.opynx.dev/v1/tickets?event_id=evt_abc123 \ -H "Authorization: Bearer YOUR_API_KEY"
/v1/tickets/purchasePurchase a ticket for an event. Returns the ticket with QR code data.
curl -X POST https://api.opynx.dev/v1/tickets/purchase \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "event_id": "evt_abc123", "tier": "General", "quantity": 2 }'Webhooks
Register webhook endpoints to receive real-time notifications for events like new streams, ticket purchases, and payouts.
/v1/webhooksRegister a new webhook endpoint.
curl -X POST https://api.opynx.dev/v1/webhooks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://yourapp.com/webhooks/opynx",
"events": ["track.streamed", "ticket.purchased", "payout.completed"]
}'Available events:
Rate Limits
| Plan | Requests / Minute | Daily Limit |
|---|---|---|
| Free | 60 | 10,000 |
| Pro | 1,000 | 500,000 |
| Enterprise | 10,000 | Unlimited |
Rate limit headers are included in every response: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.
SDKs
Official client libraries to speed up your integration.
Node.js
Availablenpm install @opynx/sdkPython
Coming Soonpip install opynxGo
Coming Soongo get github.com/opynx/sdk-go