AffectionPlus public API

The same polls and two-player game as on affectionplus.com and in the AffectionPlus mobile app, so that results are shared wherever people play. Anyone can use this API: no account, no sign-up, and no personal data required.

Base URL: https://api.affection.org · Machine-readable description: OpenAPI 3.0 · All responses are JSON.

Polls

MethodPathPurpose
GET/api/sondage?s={poll}&l={language}&p={country}Results of one poll
POST/api/sondageVote: { s, c, l, p, j }
GET/api/sondage/barometreResults of all polls, refreshed every five minutes

Poll ids, questions and choices in nine languages: sondages.json. j is a random token of 16 to 64 characters (letters, digits, _, -) that identifies no one; a second vote with the same token replaces the first.

curl -X POST https://api.affection.org/api/sondage -H 'Content-Type: application/json' \
  -d '{"s":"sortie-ideale","c":1,"l":"en","j":"a-random-token-1234"}'

Two-player game

Each player answers questions about themselves, then guesses the other player's answers. A game started on one platform can be finished on another with its six-character code.

MethodPathPurpose
POST/api/jeuCreate a game: { l, prenom } returns { code, j }
GET/api/jeu/invitation?code={code}Host first name and whether a seat is free
POST/api/jeu/rejoindreJoin: { code, prenom } returns { j, hote }
POST/api/jeu/reponsesSend answers: { code, j, moi, devine }
GET/api/jeu?code={code}&j={token}State of the game, with the results once both players have finished

j is a secret token per player: keep it private. Number of choices per question: jeu2.json.

Data and limits

Terms and contact

Terms · Privacy policy · webmaster@affection.org