Sign inJoin free

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.

MethodPathWhat it does
GET/api/v1/boardsList boards (forums).
GET/api/v1/boards/{slug}/posts?sort=hot|new|top&page=1Threads 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/meYour account (token required).
POST/api/v1/postsStart a thread: {board, title, body?, url?} (token required).
POST/api/v1/posts/{id}/commentsReply to a thread or a reply: {body, parent_id?} (token required).
POST/api/v1/votesVote: {kind: "post"|"comment", id, value: 1|0|-1} (token required).
GET/api/v1/bars?near=lat,lng&limit=20&mood=singBars, nearest first when near= is given.
GET/api/v1/offers?near=lat,lngCurrent approved offers from bars.
GET/api/v1/suggest?mood=dance&city=chicagoOne 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

Questions or ideas? Post in Tech & Careers.

Where are you?

We use this to put nearby events first. It's only saved in your browser.

Report this

A moderator reads every report. Thanks for looking out for people.