Skylet API documentation
Version 1 · JSON over HTTPS · https://api.skylet.in/v1
Quick start
1. Create a key (you must be signed in). 2. Send it as a Bearer token. 3. Read the JSON.
curl https://api.skylet.in/v1/users/skylet \
-H "Authorization: Bearer $SKYLET_KEY"Or from JavaScript (Node 20+), with the small client in @skylet/sdk:
import { Skylet } from "@skylet/sdk";
const skylet = new Skylet({ apiKey: process.env.SKYLET_KEY });
const profile = await skylet.users.get("skylet");
const page = await skylet.feed.latest({ limit: 20 });
await skylet.posts.create({ body: "Hello from the API" }); // needs the posts.write permissionAuthentication
Send the key in the Authorization header (Bearer sk_live_…) or in X-API-Key. Keys are for servers: never put one in a web page, app or public repository. If one leaks, revoke it in the portal; it stops working at once.
A key can only call the endpoints listed below, and only with the permission each one needs. Everything else (sign-in, settings, messages, ads and so on) is not available to keys.
| Permission | What it allows |
|---|---|
public.read | Read public data. Profiles, posts, comments, hashtags, trending and the newest feeds. Only what anyone can see. |
posts.write | Post on your behalf. Create and delete posts and upload pictures or videos as the account that owns the key. |
account.read | Read your account. Your own profile details. |
Reads with public.read return what a signed-out visitor sees. Calls with the other permissions act as the account that owns the key.
Endpoints
| Request | Permission | Units | What it does |
|---|---|---|---|
GET/users/{handle} | public.read | 1 | A person's or Page's public profile |
GET/users/{handle}/posts | public.read | 1 | Their posts, newest first (cursor paging) |
GET/posts/{id} | public.read | 1 | One post with its pictures or video |
GET/posts/{id}/comments | public.read | 1 | Comments on a post, oldest first, with a short reply preview |
GET/comments/{id}/replies | public.read | 1 | More replies to a comment |
GET/tags/{tag}/posts | public.read | 1 | Newest posts with a hashtag |
GET/search | public.read | 1 | Search people, Pages, posts and hashtags |
GET/trending | public.read | 1 | Hashtags taking off right now |
GET/feed/latest | public.read | 1 | Newest public posts across Skylet |
GET/feed/latest-flicks | public.read | 1 | Newest Flicks (short videos) |
GET/me | account.read | 1 | The account that owns the key |
POST/posts | posts.write | 5 | Publish a post (text, pictures or one video) |
DELETE/posts/{id} | posts.write | 5 | Delete one of your posts |
POST/media | posts.write | 20 | Upload a picture or video to attach to a post (multipart) |
GET/media/{id} | posts.write | 1 | Check an upload (videos take a moment to prepare) |
Field-by-field request and response shapes are in the interactive reference. Each endpoint above is the same one the Skylet website uses.
Paging
List endpoints take limit (up to 50) and cursor, and return { "items": [...], "nextCursor": "..." }. Pass nextCursor back as cursor for the next page; it is null on the last page. IDs are strings.
curl "https://api.skylet.in/v1/feed/latest?limit=20&cursor=102064570750738432" \
-H "Authorization: Bearer $SKYLET_KEY"Posting and uploading
With posts.write: upload pictures or a video as multipart/form-data (file part, ?purpose=post_image or flick), then attach the returned ids when you create the post. Videos take a moment to be prepared: poll GET /v1/media/{id} until its status is ready. Up to 4 pictures or one video of 90 seconds per post.
curl -X POST "https://api.skylet.in/v1/media?purpose=post_image" \
-H "Authorization: Bearer $SKYLET_KEY" -F [email protected]
# => { "id": "1020...", "status": "ready", ... }
curl -X POST https://api.skylet.in/v1/posts \
-H "Authorization: Bearer $SKYLET_KEY" -H "content-type: application/json" \
-d '{ "body": "Hello from the API", "media": [{ "id": "1020...", "alt": "A sunrise over Mumbai" }] }'Posts made through the API follow the same rules and moderation as posts made on the website.
Rate limits, units and pricing
- Every successful request costs units: a read is 1, creating or deleting a post is 5, an upload is 20. Failed requests (4xx, 5xx) and rate-limited requests are free.
- The first 10,000 units each month (UTC calendar month) are free.
- After that, units are paid from prepaid credit at ₹5 per 1,000 units (plus GST). With no credit left, calls return
402 quota_exceededuntil you add credit or the month ends. - Rate limit per key: 60 requests a minute, or 600 a minute while your account has credit.
Every response from a key carries RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset (seconds) and X-Units (what the call costs). When you exceed the limit you get 429 with Retry-After seconds. Usage is totalled every minute in the portal.
Errors
Errors are JSON: { "error": { "code": "...", "message": "...", "requestId": "..." } }. Quote the requestId when you contact us.
| 401 | invalid_api_key | The key is wrong or was revoked. |
| 403 | key_not_allowed | That endpoint is not part of the public API. |
| 403 | missing_scope | The key lacks the permission the endpoint needs. |
| 403 | api_access_blocked | Developer access for the account was switched off. |
| 402 | quota_exceeded | Free units used up and no credit left. |
| 429 | rate_limited | Too many requests: wait for Retry-After seconds. |
| 503 | api_disabled | The developer API is switched off temporarily. |
Rules
Use the API fairly. Do not scrape private information, spam, impersonate people or work around limits. Content rules and the Terms apply to everything you publish. We may switch off keys or accounts that abuse the API, and we may change prices or limits with notice in this portal.