Developers & accessibility
The DirectGay API
Read the forums, post questions, reply and vote from your own apps, scripts and assistive tools, with plain JSON or plain text.
We built this so nobody has to use our website to take part. If a screen reader, switch device, voice assistant or a custom client works better for you, use it. Everything here follows the same house rules and rate limits as the website.
1. Get a token
Sign in, go to Settings → API access, and create a personal access token. It starts with dg_. Keep it secret, and revoke it any time.
2. Make requests
Reading is open to everyone. To post, reply or vote, send your token in the Authorization header. Base URL: https://directgay.com/api/v1.
| Method | Path | What it does |
|---|---|---|
GET | /api/v1/boards | List boards (forums). |
GET | /api/v1/boards/{slug}/posts?sort=hot|new|top&page=1 | Threads in a board. Add format=text for a plain-text listing. |
GET | /api/v1/posts/{id} | One thread with all its replies (flat list with parent_id and depth). Add format=text for a readable transcript. |
GET | /api/v1/search?q=… | Search thread titles and bodies. |
GET | /api/v1/me | Your account (token required). |
POST | /api/v1/posts | Start a thread: {board, title, body?, url?} (token required). |
POST | /api/v1/posts/{id}/comments | Reply to a thread or a reply: {body, parent_id?} (token required). |
POST | /api/v1/votes | Vote: {kind: "post"|"comment", id, value: 1|0|-1} (token required). |
GET | /api/v1/bars?near=lat,lng&limit=20&mood=sing | Bars, nearest first when near= is given. |
GET | /api/v1/offers?near=lat,lng | Current approved offers from bars. |
GET | /api/v1/suggest?mood=dance&city=chicago | One suggestion for right now (bar, club, activity or event) near you or in a city, with alternates. |
Plain-text mode
Add ?format=text to board listings, threads and search to get a clean, linear transcript instead of JSON. Each reply says who wrote it and which reply it answers, which is easy to follow with a screen reader or text-to-speech.
Examples
Read a thread as text:
curl "https://directgay.com/api/v1/posts/1?format=text"
Ask a question in Ask Anything:
curl -X POST https://directgay.com/api/v1/posts \
-H "Authorization: Bearer dg_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"board":"ask","title":"How do I find an accessible gay bar in Chicago?","body":"I use a wheelchair..."}'
Reply to a thread (add parent_id to answer a specific reply):
curl -X POST https://directgay.com/api/v1/posts/42/comments \
-H "Authorization: Bearer dg_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"body":"Same question here. Following this thread."}'
Upvote a reply:
curl -X POST https://directgay.com/api/v1/votes \
-H "Authorization: Bearer dg_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"kind":"comment","id":7,"value":1}'
Rules of the road
- Errors come back as
{"ok": false, "error": "…"}with a normal HTTP status, in plain English. - Rate limits match the website: a few posts a minute, more for votes. A
429means slow down. - No scraping members' profiles, no automated posting on other people's behalf, and no bots pretending to be people. Label automated accounts as such in their bio.
- Cross-origin requests are allowed (CORS), and cookies are ignored on
/api/v1. Only tokens work there.
Questions or ideas? Post in Tech & Careers.