# Music Twin > Music Twin matches people by their Spotify taste. A user pastes their Spotify Wrapped share link (or a public Spotify profile link), picks a nickname, and gets the people whose top artists, genres and songs are closest to theirs, with a match percentage and a chat to say hi. Other sites can add their users through the federation API so everyone is matched on one shared board. ## Pages - [Home](https://twin.modulime.com/): join with a Wrapped link and a nickname - [Profile](https://twin.modulime.com/u/lime): a user's top genre, top artists and, for visitors who joined, their match with them - [Federation](https://twin.modulime.com/federate): how other sites add their users ## Federation API Many sites now help people find their music twin, and each one only matches its own users, so every community stays small. Federation merges them: a site sends its users here, they are matched against everyone on every federated site and on Music Twin itself, and the matches come back in the response. Users keep their nickname and can chat with anyone on the board. The `platform` field records where each user came from but is never shown or used for matching. Each server can add up to 200 users an hour. All calls are `POST` with a JSON body and return JSON. Errors return status 400 with `{"error": "", "args": [...]}`, for example `nicknameTaken`, `invalidLink`, `wrongCard` or `tooManyJoins`. Call it from your server; browsers on other origins are rejected. ### Add a user `POST https://twin.modulime.com/api/federate` - `platform` (required): your site's name or domain, stored and never shown - `nickname` (required): 2 to 20 letters, numbers, dots or underscores, stored lowercased and unique across all platforms - `link` (required): a Spotify Wrapped share link (the summary or top moments card) or a public Spotify profile link - `age` (optional): 13 to 99 - `horoscope` (optional): one of Aries, Taurus, Gemini, Cancer, Leo, Virgo, Libra, Scorpio, Sagittarius, Capricorn, Aquarius, Pisces - `city` (optional): free text, up to 60 characters, ideally "City, Country" - `email` (optional): to tell the user when a twin shows up Returns the user's `id` and `token`, plus their `nickname`, `stats` (top artists, genres, Wrapped minutes and top genre), `about`, `matches` (up to 3, each with `nickname`, `percent`, `shared` artists, shared `genres`, `discover` artists and `top` artist images), `number`, `count` and `conversations`. ### Python example Sends all your users and prints their matches, with only the standard library. Keep each `token` to read the user again later. ```python from json import dumps, loads from urllib.error import HTTPError from urllib.request import Request, urlopen users = [ {'nickname': 'vinyl.lover', 'link': 'https://www.spotify.com/wrapped-share/...', 'age': 24, 'horoscope': 'Gemini', 'city': 'Milan, Italy'}, ] for user in users: request = Request('https://twin.modulime.com/api/federate', dumps({'platform': 'yoursite.com', **user}).encode(), {'Content-Type': 'application/json'}) try: response = loads(urlopen(request).read()) print(response['nickname'], response['token'], [(match['nickname'], match['percent']) for match in response['matches']]) except HTTPError as error: print(user['nickname'], loads(error.read())['error']) ``` ### Read a user later `POST https://twin.modulime.com/api/me` with the header `Token: ` returns the same object with fresh matches. ### Other calls - `POST /api/profile` with `{"nickname": "..."}`: a public profile - `POST /api/messages` with `Token` and `{"nickname": "..."}`: the conversation with someone - `POST /api/send` with `Token` and `{"nickname": "...", "body": "..."}`: send a message - `POST /api/available` with `{"nickname": "..."}`: whether a nickname is free