Integration Examples
Complete code examples for integrating with the Emberly API in Node.js, Python, Go, and Bash.
Real-world examples of using the Emberly API in Node.js, Python, Go, and Bash.
Prerequisites
All examples require:
- Upload Token — Find yours at Dashboard → Settings → Profile → Upload Token
- Base URL —
https://embrly.ca/api - Auth header —
Authorization: Bearer YOUR_UPLOAD_TOKEN
Some endpoints (profile, domains, analytics) require a browser session cookie rather than a bearer token. These are used by the dashboard and are not typical for external integrations. The examples below cover bearer-token endpoints.
Node.js / JavaScript
Basic Setup
Example 1: Upload a File
Example 2: Shorten a URL
Example 3: Delete a File
Example 4: Set File Expiry
Example 5: Add a File Collaborator
Python
Installation
Basic Setup
Example 1: Upload a File
Example 2: Shorten a URL
Example 3: Download a File
Example 4: Batch Upload a Directory
Go
Installation
Basic Setup
Example 1: Upload a File
Example 2: Create a Short URL
Bash / cURL
Setup
Example 1: Upload a File
Example 2: Shorten a URL
Example 3: Delete a File
Example 4: Upload from Screenshot
Error Handling
All API errors return { "success": false, "error": "..." }.
Rate Limits
File uploads and most API endpoints aren't rate-limited by plan — only a handful of security-sensitive endpoints (registration, password reset, contact form, domain verification) have flat, IP-scoped limits. See the User API Reference for the full list. A limited endpoint returns 429 Too Many Requests with a Retry-After header when exceeded.