Friday, June 15, 2018

Using FTDNA's API: Commands and Explanations

After hearing from all of you, I am now fairly certain that anyone is, in fact, allowed to access FTDNA's family finder API. And, as a bonus, I learned some new things about how APIs function in websites as well (special thanks for that goes to the anonymous commenter on the previous post). The question that remains is whether or not programmatically accessing it is against FTDNA's terms of use, and if anyone knows anything about that I'd be very happy to hear it, as I can think of a few things I want to try doing with the API and my best friend, python.

Anyways, this new post will go over the ways you can use the API and the different requests you can send to it. It's not all-inclusive and only includes the things I thought were important/most useful.

Please note, this post will include a lot of technical words without a lot of detailed explanation. If you just want to try it out for yourself simply click one of the links in the post to see the match data after signing into ftdna in your web browser.

How to Send GET Requests (In General)

There are two ways you can send Requests. The first is to just put the URL in your browser and the 2nd is to use Postman. For the most part, I use because making requests in it is faster and its easier to change parameters, however, I will use my browser in this tutorial because that will make it easier to collapse things/ limit the amount of censoring I have to do.

Match Lists

Basic Match List

The JSON Data for the Basic Match List

To return the information for your first 9 matches in JSON format (the same number as you would normally see on the screen) Use the following url:

Full Match List

You'll notice that the first line of JSON data returned by the last command has the total count of matches you have. You can use this number or any number larger than it in the url to print out that number of matches. In the url set page=1 (to start on your first page of matches) and set pageSize=numberofmatches. Here is an example url: