Skip to content

Instantly share code, notes, and snippets.

@rtt
Last active October 17, 2024 17:55
Show Gist options
  • Save rtt/10403467 to your computer and use it in GitHub Desktop.
Save rtt/10403467 to your computer and use it in GitHub Desktop.
Tinder API Documentation

Tinder API documentation

Note: this was written in April/May 2014 and the API may has definitely changed since. I have nothing to do with Tinder, nor its API, and I do not offer any support for anything you may build on top of this. Proceed with caution

http://rsty.org/

I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)

API Details

Host api.gotinder.com
Protocol https only

Request headers

Header name Description / example Required?
X-Auth-Token A UUID4 format authentication token obtained via the /auth api endpoint Yes
Content-type application/json Yes
app_version 3 no
platform ios no
User-agent User-Agent: Tinder/3.0.4 (iPhone; iOS 7.1; Scale/2.00) Yes
os_version 700001 No

Note: all curl examples below omit headers for brevity -- you'll need to add the required headers shown in the table above

Authenticating

You'll need to supply a facebook auth token and an associated facebook id.

> curl -X POST https://api.gotinder.com/auth --data '{"facebook_token": fb_token, "facebook_id": fb_user_id}'

The easiest way to get this is to go here, log in and then pick the auth token out of the URL you are redirected to.

Response:

{
	"token": "8c839cee-0980-4b73-861b-8739cb597f57",
	"user": { ... }, 
	"globals": { ... },
	"versions": { ... }
}

Updating your profile

> curl -X POST https://api.tinder.com/profile --data '{"age_filter_min": 26, "gender": 1, "age_filter_max": 32, "distance_filter": 14}'

Parameter info:

Gender 0: Male
1: Female
age_filter_min int of min age match
age_filter_max int of max age match
distance_filter max search radius in kilometers

Reporting a user

> curl -X POST 'https://api.gotinder.com/report/{_id} --data '{"cause": cause_id}'

Note cause_id: should be 1 or 2, (1 is spam, 2 is inappropriate/offensive)

Message sending

Send a message to a match. Note you'll get a 500 back if you try to send a message to someone who isn't a match

curl 'https://api.gotindaer.com/user/matches/{_id} --data '{"message": "your message here"}'

response:

{
	"_id":"53467235483cb56c475cc1d6",
	"from":"53430689ab3c04c13e006ffb",
	"to":"533a59ea52046fc077002815",
	"match_id":"53464b0728ac73976d0a3fbf",
	"sent_date":"2014-04-10T10:28:05.764Z",
	"message":"hi!",
	"created_date":"2014-04-10T10:28:05.764Z"
}

Updating your location

curl 'https://api.gotindaer.com/user/ping --data '{"lat": latitude, "lon": longitude}'

{
	"status": 200,
	"error": "position change not significant"
}

Get "updates"

> curl 'https://api.gotindaer.com/updates'

Response:

{
	"matches": [{
		"_id": "53464b0728ac73976d0a3fbf",
		"messages": [{
			"_id": "534651198ce6da797248c1a3",
			"match_id": "53464b0728ac73976d0a3fbf",
			"to": "53430689ab3c04c13e006ffb",
			"from": "533a59ea52046fc077002815",
			"message": "hi  .... how is it going?",
			"sent_date": "2014-04-10T08:06:49.800Z",
			"created_date": "2014-04-10T08:06:49.800Z",
			"timestamp": 1397117209800
		}, {
			"_id": "53466fd298b7278b72156523",
			"match_id": "53464b0728ac73976d0a3fbf",
			"to": "533a59ea52046fc077002815",
			"from": "53430689ab3c04c13e006ffb",
			"message": "Good thanks you? :)",
			"sent_date": "2014-04-10T10:17:54.379Z",
			"created_date": "2014-04-10T10:17:54.379Z",
			"timestamp": 1397125074379
		}],
		"last_activity_date": "2014-04-10T10:17:54.379Z"
	}],
	"blocks": [],
	"lists": [],
	"deleted_lists": [],
	"last_activity_date": "2014-04-10T10:17:54.379Z"
}

To 'like' or 'pass' a User

> curl https://api.gotinder.com/{like|pass}/{_id}

Response:

{match: match_result}

match_result will be true if they like you, false if they haven't liked you or don't like you

Recommendations

> curl https://api.gotinder.com/user/recs
{
    "status": 200,
    "results": [{
        "distance_mi": 2,
        "common_like_count": 0,
        "common_friend_count": 0,
        "common_likes": [],
        "common_friends": [],
        "_id": "518d666a2a00df0e490000b9",
        "bio": "",
        "birth_date": "1986-05-17T00:00:00.000Z",
        "gender": 1,
        "name": "Elen",
        "ping_time": "2014-04-08T11:59:18.494Z",
        "photos": [{
            "id": "fea4f480-7ce0-4143-a310-a03c2b2cdbc6",
            "main": true,
            "crop": "source",
            "fileName": "fea4f480-7ce0-4143-a310-a03c2b2cdbc6.jpg",
            "extension": "jpg",
            "processedFiles": [{
                "width": 640,
                "height": 640,
                "url": "http://images.gotinder.com/518d666a2a00df0e490000b9/640x640_fea4f480-7ce0-4143-a310-a03c2b2cdbc6.jpg"
            }, {
                "width": 320,
                "height": 320,
                "url": "http://images.gotinder.com/518d666a2a00df0e490000b9/320x320_fea4f480-7ce0-4143-a310-a03c2b2cdbc6.jpg"
            }, {
                "width": 172,
                "height": 172,
                "url": "http://images.gotinder.com/518d666a2a00df0e490000b9/172x172_fea4f480-7ce0-4143-a310-a03c2b2cdbc6.jpg"
            }, {
                "width": 84,
                "height": 84,
                "url": "http://images.gotinder.com/518d666a2a00df0e490000b9/84x84_fea4f480-7ce0-4143-a310-a03c2b2cdbc6.jpg"
            }],
            "url": "http://images.gotinder.com/518d666a2a00df0e490000b9/fea4f480-7ce0-4143-a310-a03c2b2cdbc6.jpg"
        }, {
            "url": "http://images.gotinder.com/518d666a2a00df0e490000b9/5c1d3231-5a75-4a07-91ff-5c012716583f.jpg",
            "processedFiles": [{
                "url": "http://images.gotinder.com/518d666a2a00df0e490000b9/640x640_pct_0_29.5312464_540_540_5c1d3231-5a75-4a07-91ff-5c012716583f.jpg",
                "height": 640,
                "width": 640
            }, {
                "url": "http://images.gotinder.com/518d666a2a00df0e490000b9/320x320_pct_0_29.5312464_540_540_5c1d3231-5a75-4a07-91ff-5c012716583f.jpg",
                "height": 320,
                "width": 320
            }, {
                "url": "http://images.gotinder.com/518d666a2a00df0e490000b9/172x172_pct_0_29.5312464_540_540_5c1d3231-5a75-4a07-91ff-5c012716583f.jpg",
                "height": 172,
                "width": 172
            }, {
                "url": "http://images.gotinder.com/518d666a2a00df0e490000b9/84x84_pct_0_29.5312464_540_540_5c1d3231-5a75-4a07-91ff-5c012716583f.jpg",
                "height": 84,
                "width": 84
            }],
            "extension": "jpg",
            "fileName": "5c1d3231-5a75-4a07-91ff-5c012716583f.jpg",
            "main": false,
            "ydistance_percent": 0.75,
            "yoffset_percent": 0.04101562,
            "xoffset_percent": 0,
            "id": "5c1d3231-5a75-4a07-91ff-5c012716583f",
            "xdistance_percent": 1
        }, {
            "url": "http://images.gotinder.com/518d666a2a00df0e490000b9/5abd87e5-a181-4946-a8b9-880926a78943.jpg",
            "processedFiles": [{
                "url": "http://images.gotinder.com/518d666a2a00df0e490000b9/640x640_pct_0_118.125_540_540_5abd87e5-a181-4946-a8b9-880926a78943.jpg",
                "height": 640,
                "width": 640
            }, {
                "url": "http://images.gotinder.com/518d666a2a00df0e490000b9/320x320_pct_0_118.125_540_540_5abd87e5-a181-4946-a8b9-880926a78943.jpg",
                "height": 320,
                "width": 320
            }, {
                "url": "http://images.gotinder.com/518d666a2a00df0e490000b9/172x172_pct_0_118.125_540_540_5abd87e5-a181-4946-a8b9-880926a78943.jpg",
                "height": 172,
                "width": 172
            }, {
                "url": "http://images.gotinder.com/518d666a2a00df0e490000b9/84x84_pct_0_118.125_540_540_5abd87e5-a181-4946-a8b9-880926a78943.jpg",
                "height": 84,
                "width": 84
            }],
            "extension": "jpg",
            "fileName": "5abd87e5-a181-4946-a8b9-880926a78943.jpg",
            "main": false,
            "ydistance_percent": 0.75,
            "yoffset_percent": 0.1640625,
            "xoffset_percent": 0,
            "id": "5abd87e5-a181-4946-a8b9-880926a78943",
            "xdistance_percent": 1
        }, {
            "url": "http://images.gotinder.com/518d666a2a00df0e490000b9/5e168698-a034-40c0-b7fb-7c05743f2310.jpg",
            "processedFiles": [{
                "url": "http://images.gotinder.com/518d666a2a00df0e490000b9/640x640_pct_157.570344_0_405_405_5e168698-a034-40c0-b7fb-7c05743f2310.jpg",
                "height": 640,
                "width": 640
            }, {
                "url": "http://images.gotinder.com/518d666a2a00df0e490000b9/320x320_pct_157.570344_0_405_405_5e168698-a034-40c0-b7fb-7c05743f2310.jpg",
                "height": 320,
                "width": 320
            }, {
                "url": "http://images.gotinder.com/518d666a2a00df0e490000b9/172x172_pct_157.570344_0_405_405_5e168698-a034-40c0-b7fb-7c05743f2310.jpg",
                "height": 172,
                "width": 172
            }, {
                "url": "http://images.gotinder.com/518d666a2a00df0e490000b9/84x84_pct_157.570344_0_405_405_5e168698-a034-40c0-b7fb-7c05743f2310.jpg",
                "height": 84,
                "width": 84
            }],
            "extension": "jpg",
            "fileName": "5e168698-a034-40c0-b7fb-7c05743f2310.jpg",
            "main": false,
            "ydistance_percent": 1,
            "yoffset_percent": 0,
            "xoffset_percent": 0.2188477,
            "id": "5e168698-a034-40c0-b7fb-7c05743f2310",
            "xdistance_percent": 0.5625
        }],
        "birth_date_info": "fuzzy birthdate active, not displaying real birth_date"
    }, {
        "distance_mi": 4,
        "common_like_count": 0,
        "common_friend_count": 0,
        "common_likes": [],
        "common_friends": [],
        "_id": "52cfc097f43cd91a67003639",
        "bio": "",
        "birth_date": "1987-11-02T00:00:00.000Z",
        "gender": 1,
        "name": "Cristina",
        "ping_time": "2014-04-06T16:52:51.605Z",
        "photos": [{
            "id": "4ab7173f-7884-4fe3-872f-32c01d77de2a",
            "main": "main",
            "shape": "center_square",
            "fileName": "4ab7173f-7884-4fe3-872f-32c01d77de2a.jpg",
            "extension": "jpg",
            "processedFiles": [{
                "width": 640,
                "height": 640,
                "url": "http://images.gotinder.com/52cfc097f43cd91a67003639/640x640_4ab7173f-7884-4fe3-872f-32c01d77de2a.jpg"
            }, {
                "width": 320,
                "height": 320,
                "url": "http://images.gotinder.com/52cfc097f43cd91a67003639/320x320_4ab7173f-7884-4fe3-872f-32c01d77de2a.jpg"
            }, {
                "width": 172,
                "height": 172,
                "url": "http://images.gotinder.com/52cfc097f43cd91a67003639/172x172_4ab7173f-7884-4fe3-872f-32c01d77de2a.jpg"
            }, {
                "width": 84,
                "height": 84,
                "url": "http://images.gotinder.com/52cfc097f43cd91a67003639/84x84_4ab7173f-7884-4fe3-872f-32c01d77de2a.jpg"
            }],
            "url": "http://images.gotinder.com/52cfc097f43cd91a67003639/4ab7173f-7884-4fe3-872f-32c01d77de2a.jpg"
        }, {
            "id": "bb8ac90b-f48a-4a1c-8cba-0c05d26f1b47",
            "shape": "center_square",
            "fileName": "bb8ac90b-f48a-4a1c-8cba-0c05d26f1b47.jpg",
            "extension": "jpg",
            "processedFiles": [{
                "width": 640,
                "height": 640,
                "url": "http://images.gotinder.com/52cfc097f43cd91a67003639/640x640_bb8ac90b-f48a-4a1c-8cba-0c05d26f1b47.jpg"
            }, {
                "width": 320,
                "height": 320,
                "url": "http://images.gotinder.com/52cfc097f43cd91a67003639/320x320_bb8ac90b-f48a-4a1c-8cba-0c05d26f1b47.jpg"
            }, {
                "width": 172,
                "height": 172,
                "url": "http://images.gotinder.com/52cfc097f43cd91a67003639/172x172_bb8ac90b-f48a-4a1c-8cba-0c05d26f1b47.jpg"
            }, {
                "width": 84,
                "height": 84,
                "url": "http://images.gotinder.com/52cfc097f43cd91a67003639/84x84_bb8ac90b-f48a-4a1c-8cba-0c05d26f1b47.jpg"
            }],
            "url": "http://images.gotinder.com/52cfc097f43cd91a67003639/bb8ac90b-f48a-4a1c-8cba-0c05d26f1b47.jpg"
        }, {
            "id": "dabe1c27-f186-48f2-807f-8a68e3831fe9",
            "shape": "center_square",
            "fileName": "dabe1c27-f186-48f2-807f-8a68e3831fe9.jpg",
            "extension": "jpg",
            "processedFiles": [{
                "width": 640,
                "height": 640,
                "url": "http://images.gotinder.com/52cfc097f43cd91a67003639/640x640_dabe1c27-f186-48f2-807f-8a68e3831fe9.jpg"
            }, {
                "width": 320,
                "height": 320,
                "url": "http://images.gotinder.com/52cfc097f43cd91a67003639/320x320_dabe1c27-f186-48f2-807f-8a68e3831fe9.jpg"
            }, {
                "width": 172,
                "height": 172,
                "url": "http://images.gotinder.com/52cfc097f43cd91a67003639/172x172_dabe1c27-f186-48f2-807f-8a68e3831fe9.jpg"
            }, {
                "width": 84,
                "height": 84,
                "url": "http://images.gotinder.com/52cfc097f43cd91a67003639/84x84_dabe1c27-f186-48f2-807f-8a68e3831fe9.jpg"
            }],
            "url": "http://images.gotinder.com/52cfc097f43cd91a67003639/dabe1c27-f186-48f2-807f-8a68e3831fe9.jpg"
        }, {
            "url": "http://images.gotinder.com/52cfc097f43cd91a67003639/59263e9d-6d76-4f42-8c8e-b4cf635b03c7.jpg",
            "processedFiles": [{
                "url": "http://images.gotinder.com/52cfc097f43cd91a67003639/640x640_59263e9d-6d76-4f42-8c8e-b4cf635b03c7.jpg",
                "height": 640,
                "width": 640
            }, {
                "url": "http://images.gotinder.com/52cfc097f43cd91a67003639/320x320_59263e9d-6d76-4f42-8c8e-b4cf635b03c7.jpg",
                "height": 320,
                "width": 320
            }, {
                "url": "http://images.gotinder.com/52cfc097f43cd91a67003639/172x172_59263e9d-6d76-4f42-8c8e-b4cf635b03c7.jpg",
                "height": 172,
                "width": 172
            }, {
                "url": "http://images.gotinder.com/52cfc097f43cd91a67003639/84x84_59263e9d-6d76-4f42-8c8e-b4cf635b03c7.jpg",
                "height": 84,
                "width": 84
            }],
            "extension": "jpg",
            "fileName": "59263e9d-6d76-4f42-8c8e-b4cf635b03c7.jpg",
            "main": false,
            "ydistance_percent": 0.75,
            "yoffset_percent": 0.08554687,
            "xoffset_percent": 0,
            "id": "59263e9d-6d76-4f42-8c8e-b4cf635b03c7",
            "xdistance_percent": 1
        }],
        "birth_date_info": "fuzzy birthdate active, not displaying real birth_date"
    }, ... ]
}
@TaisKha
Copy link

TaisKha commented Jul 22, 2021

I receive a 404 error when I am trying to send a message. How can I fix it?

@AbderrahmenM
Copy link

@brusselburg

Yes it's easy. Just send a POST request to https://api.gotinder.com/updates?locale=en. Pass in empty string for the last_activity_date parameter and you'll get a list of all matches under the "matches" property.

Can you please tell me where are you finding such informations ? I am struggling to find documentation

@uzyk88
Copy link

uzyk88 commented Aug 30, 2021

@AbderrahmenM just make while loop with next_page_token and fetch all the matches.

Does anyone know here which endpoint is used for top picks?

@jahjahLemonade
Copy link

Do anybody know how to retrieve all messages from all matches contacted?

@hejhopsa
Copy link

@brusselburg @smleggo @SeanLF
Hi Guys, saying that Im not a code guy isn't enough.. Anyway for some reason Im forced to use the webbrowser version of tinder and the share button of profile is missing, anyone could help with that? Is it possible to find users ID and than prepare a URL to share?

@will-code-for-pizza
Copy link

will-code-for-pizza commented Jan 4, 2022

Sorry guys, I get stucked at the very beginning...

$ curl -X POST https://api.gotinder.com/auth --data '{"facebook_token": EAAGm0PX4ZCpsBAFG65ZXXXXXXXXXXXRc508ynKIaxSc6Lny9uoHUepMdAZCeKLzsLbezge3Nkj6e38yrn51hhs2gYXp5C0pALviny8Oc06TYGymZA16G2fmw7KoXXXXXXXXXXXXl4NYg3ZChZB9qmriz599to36lEJeNFymdvonkeIT9ZADaWCdUZAQZDZD, "facebook_id": 103XXXXXXXXX6822}'

just returns an

OK

Shouldn't the Tinder API token be issued here?

Regards

UPDATE:

Solved by myself:

$ curl -sX POST https://api.gotinder.com/v2/auth/login/facebook --data-raw '{"token":"EAAGm0PX4ZCpsBAFG65ZXXXXXXXXXXXRc508ynKIaxSc6Lny9uoHUepMdAZCeKLzsLbezge3Nkj6e38yrn51hhs2gYXp5C0pALviny8Oc06TYGymZA16G2fmw7KoXXXXXXXXXXXXl4NYg3ZChZB9qmriz599to36lEJeNFymdvonkeIT9ZADaWCdUZAQZDZD","facebook_id":"103XXXXXXXXX6822"}' | python -m json.tool
`

@klarksontash
Copy link

klarksontash commented Apr 12, 2022

does anybody know, cant i retrieve user's _id from en expired share link? i.e "go.tinder.com/SlTqHmJVYDg-Lauren" ?
so api.gotinder.com/user/SlTqHmJVYDg returns

{
    "error": "Link expired"
}

@Cai-Jianlin
Copy link

does anybody know, cant i retrieve user's _id from en expired share link? i.e "go.tinder.com/SlTqHmJVYDg-Lauren" ? so api.gotinder.com/user/SlTqHmJVYDg returns

{
    "error": "Link expired"
}

Hello, Do you have your running status?

@Micjoey
Copy link

Micjoey commented May 27, 2022

I ran into {'meta': {'status': 429}, 'error': {'message': 'RATE_LIMITED', 'code': 42901}} while making debugging and making requests to TINDER_URL + "/v2/recs/core". Does anyone know how long I am throttled? I can't seem to find it anywhere and other api calls seem to work fine.

@morozp
Copy link

morozp commented Nov 12, 2022

Is any body know what api link to get all unliked users?

@whelamc
Copy link

whelamc commented Nov 12, 2022

none

@morozp
Copy link

morozp commented Nov 14, 2022

is tinder web version has page for user for example tinder/user/{user-id} ?

@Rhenm091619
Copy link

Rhenm091619 commented Jan 6, 2023

Posible way to fetch image verification poses?

API.gotinder.com/v2/verification/selfie/start?

@PyotrAndreev
Copy link

@AbderrahmenM just make while loop with next_page_token and fetch all the matches.

Does anyone know here which endpoint is used for top picks?

Could you explain your idea about looping with next_page_token?
Where should I put the next_page_token in request to recive next page of matches?
requests.get(TINDER_URL + f"/v2/matches?count={limit}", headers={"X-Auth-Token": self._token}).json()

@Stormblessed39
Copy link

Tried to get the user recs but am getting a 404 now, any ideas?

@paolocarrara
Copy link

Hey everybody, I intend to create a RapidAPI of Tinder API, are you guys interested? I may have some ready until the end of the weekend.

@rafaelkapela
Copy link

@AbderrahmenM just make while loop with next_page_token and fetch all the matches.

Does anyone know here which endpoint is used for top picks?

For anyone who asked about the next_page_token...

You just should add &page_token=$next_page_token in the /v2/matches endpoint.

@martinaedma
Copy link

Is it possible to pass(nope) via API ?
I tried to use https://api.gotinder.com/pass/{id} endpoint with different methods but didnt work.
Anyone know how what that endpoint is?

@paolocarrara
Copy link

Is it possible to pass(nope) via API ? I tried to use https://api.gotinder.com/pass/{id} endpoint with different methods but didnt work. Anyone know how what that endpoint is?

This is the right endpoint to pass (dislike) someone, I can't see why it is not working if you are passing the user ID and your authorization token it should work as expected. Can you give us more info, error message (request response) would be great.

@PetersServers
Copy link

PetersServers commented Apr 29, 2023

I have this call that results from this discussion, which returns a 401 @AbderrahmenM, this doesn't really work. could you specify how to edit this request according to your idea?

def get_all_matches(self):
data = requests.post(TINDER_URL + "/v2/updates?locale=en", json={"last_activity_date": ""},
headers={"X-Auth-Token": self._token}, verify=True).json()

@martinaedma
Copy link

martinaedma commented May 5, 2023

Is it possible to pass(nope) via API ? I tried to use https://api.gotinder.com/pass/{id} endpoint with different methods but didnt work. Anyone know how what that endpoint is?

This is the right endpoint to pass (dislike) someone, I can't see why it is not working if you are passing the user ID and your authorization token it should work as expected. Can you give us more info, error message (request response) would be great.

Yes it is actually working as intended.
Is there a different endpoint for passing a fast-match?
If somone has liked you and you send a pass on that user, it will still remain in fast-matches.

If you buy tinder gold, you can swipe left on someone who has liked you and fast match goes away. Is that a different endpoint?

@charlescol
Copy link

charlescol commented May 14, 2023

Hi Everyone,

Does anyone have an idea about how Tinder refreshes its token? I'm experiencing a 401 (Unauthorized) response when trying to authenticate using the endpoint https://api.gotinder.com/v2/auth/login/facebook. Additionally, it seems that the endpoint https://api.gotinder.com/v3/auth/login?locale=en uses the protobuf protocol, and I'm having trouble understanding the provided request body.

Any hints or insights would be greatly appreciated.

@paolocarrara
Copy link

charlescol

As far as I remember you call the endpoint related to the method that you used to login, in my case I always used the SMS method to authenticate so it should be https://api.gotinder.com/v2/auth/login/sms, you should do a post to this endpoint with JSON body as follows:

{
 refresh_token: "your-refresh-token" 
}

Yeah, to login it now uses the protobuf format, personally I have spent quite some time trying to figure it out how to solve this problem but got no where and to be honest in the end it does not really matter because once you log in for the first time you can automate the process of token renewal.

@paolocarrara
Copy link

Is it possible to pass(nope) via API ? I tried to use https://api.gotinder.com/pass/{id} endpoint with different methods but didnt work. Anyone know how what that endpoint is?

This is the right endpoint to pass (dislike) someone, I can't see why it is not working if you are passing the user ID and your authorization token it should work as expected. Can you give us more info, error message (request response) would be great.

Yes it is actually working as intended. Is there a different endpoint for passing a fast-match? If somone has liked you and you send a pass on that user, it will still remain in fast-matches.

If you buy tinder gold, you can swipe left on someone who has liked you and fast match goes away. Is that a different endpoint?

Don't know man, you probably need to look in the request as it made in the browser if possible. I don't have Tinder Gold anymore to test it.

@gelodefaultbrain
Copy link

Hey guys, anyone have any ideas why SMS auth isn't working? I can't seem to receive text message anymore? Thanks

Code

import requests
import json

CODE_REQUEST_URL = "https://api.gotinder.com/v2/auth/sms/send?auth_type=sms"
CODE_VALIDATE_URL = "https://api.gotinder.com/v2/auth/sms/validate?auth_type=sms"
TOKEN_URL = "https://api.gotinder.com/v2/auth/login/sms" #"https://api.gotinder.com/v3/auth/login?locale=en"

HEADERS = {'user-agent': 'Tinder/11.4.0 (iPhone; iOS 12.4.1; Scale/2.00)', 'content-type': 'application/json'}

def send_otp_code(phone_number):
    data = {'phone_number': phone_number}
    r = requests.post(CODE_REQUEST_URL, headers=HEADERS, data=json.dumps(data), verify=True)
    print(r.text)
    response = r.json()
    if(response.get("data")['sms_sent'] == False):
        return False
    else:
        return True

def get_refresh_token(otp_code, phone_number):
    data = {'otp_code': otp_code, 'phone_number': phone_number}
    r = requests.post(CODE_VALIDATE_URL, headers=HEADERS, data=json.dumps(data), verify=True)
    print(r.url)
    response = r.json()
    if(response.get("data")["validated"] == False):
        return False
    else:
        return response.get("data")["refresh_token"]
    
def get_api_token(refresh_token):
    data = {'refresh_token': refresh_token }
    r = requests.post(TOKEN_URL, headers=HEADERS, data=json.dumps(data), verify=True)
    print(r.url)
    response = r.json()

    #if response["is_new_user"]:
    #    return response["data"]["onboarding_token"]
    print(response)
    return response["data"]["api_token"]

phone_number = input("Please enter your phone number under the international format (country code + number): ")
log_code = send_otp_code(phone_number)
otp_code = input("Please enter the code you've received by sms: ")
refresh_token = get_refresh_token(otp_code, phone_number)
print("Here is your Tinder token: " + str(get_api_token(refresh_token)))

@Scylla2020
Copy link

def get_api_token(refresh_token):
data = {'refresh_token': refresh_token }
r = requests.post(TOKEN_URL, headers=HEADERS, data=json.dumps(data), verify=True)
print(r.url)
response = r.json()

#if response["is_new_user"]:
#    return response["data"]["onboarding_token"]
print(response)
return response["data"]["api_token"]

phone_number = input("Please enter your phone number under the international format (country code + number): ")
log_code = send_otp_code(phone_number)
otp_code = input("Please enter the code you've received by sms: ")
refresh_token = get_refresh_token(otp_code, phone_number)
print("Here is your Tinder token: " + str(get_api_token(refresh_token)))

Does the refresh token even expire? Not sure if they are handling the expiration server side since time value isnt in the token. Because if not then you can just get the token once through the website then continue with rest of the code. Not sure what changed with the sms login

@gelodefaultbrain
Copy link

Well yea

def get_api_token(refresh_token):
data = {'refresh_token': refresh_token }
r = requests.post(TOKEN_URL, headers=HEADERS, data=json.dumps(data), verify=True)
print(r.url)
response = r.json()

#if response["is_new_user"]:
#    return response["data"]["onboarding_token"]
print(response)
return response["data"]["api_token"]

phone_number = input("Please enter your phone number under the international format (country code + number): ")
log_code = send_otp_code(phone_number)
otp_code = input("Please enter the code you've received by sms: ")
refresh_token = get_refresh_token(otp_code, phone_number)
print("Here is your Tinder token: " + str(get_api_token(refresh_token)))

Does the refresh token even expire? Not sure if they are handling the expiration server side since time value isnt in the token. Because if not then you can just get the token once through the website then continue with rest of the code. Not sure what changed with the sms login

well yeah that kinda works actually but , of you course I actually created some interface for it using api itself, not relying on the website itself. What happened tho :( just woke up and didn't work anymore. Maybe an update from the api endpoints?

@R0L02796
Copy link

Tried to get the user recs but am getting a 404 now, any ideas?

Im having the same issue di you fix it?

@Scylla2020
Copy link

Try this one instead https://github.com/fbessez/Tinder. There's a solution in the pr

@R0L02796
Copy link

yeah thank u i was able to solve it by changing the api client i had for get instead of a post of user/recs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment