Skip to content

Documentation and examples for using the WikiTree.com API

Notifications You must be signed in to change notification settings

vorenhoutgithub/wikitree-api

 
 

Repository files navigation

WikiTree API

Introduction

The WikiTree API provides read-only access to much of the profile data on the site. You can use it for your own applications that read and display the contents. If you want to enable updates to the content, you can use the data from the API and send your users through edit functions on the site.

Getting Started

The WikiTree API is called through the end point: https://api.wikitree.com/api.php

Parameters can be passed via either GET or POST. For most functions, you will specify an "action", and many also use a "key" to indicate which profile(s) you're working on. The results are returned as JSON. For example:

curl 'https://api.wikitree.com/api.php?action=getProfile&key=Clemens-1'

[
  {
    "page_name": "Clemens-1",
    "profile": {
      "Id": 5185,
      "Name": "Clemens-1",
      "FirstName": "Samuel",
      "MiddleName": "Langhorne",
      "LastNameAtBirth": "Clemens",
	...
    },
    "status": 0
  }
]

The "status" field is generally zero (0) if there is no error. It can contain an error message if something went wrong.

curl 'https://api.wikitree.com/api.php?action=getProfile&key=ThisIsABadWikiTreeID'

[
  {
    "page_name": "ThisIsABadWikiTreeID",
    "status": "Illegal WikiTree ID"
  }
]

Person profiles on WikiTree have a Privacy level. Only public profiles can be viewed through the API unless you authenticate as a particular user. Once you've authenticated, you can retrieve the data for profiles that have you on the trusted list. Requesting a private profile does not generate an error, but you only receive a privacy-limited data set.

curl 'https://api.wikitree.com/api.php?action=getProfile&key=Burk-1'

[
  {
    "page_name": "Burk-1",
    "profile": {
      "Id": 7352,
      "Name": "Burk-1",
      "IsPerson": 1
    },
    "status": 0
  }
]

Actions

Action Result
getProfile Retrieve a Person or Free-Space profile
getPerson Retrieve a Person
getBio Get the biography text for a person profile
getPhotos Get the photos connected to a profile
getPeople Get the multiple profiles by key and/or relationship
getAncestors Get multiple generations of ancestors of a person profile, following father and mother
getDescendants Get multiple generations of descendants of a person profile, following children
getRelatives Get parents, children, siblings, and/or spouses of a profile
getWatchlist Get the profiles on the watch list of the logged-in profile
getDNATestsByTestTaker Get the list of DNA Tests taken by a profile
getConnectedProfilesByDNATest Get the profiles connected via DNA test
getConnectedDNATestsByProfile Get the DNA Tests connected to a profile
getCategories Get the Categories connected to a profile
searchPerson Search for person profiles
clientLogin Authenticate as a WikiTree.com member

Example

curl 'https://api.wikitree.com/api.php?action=getProfile&key=Franklin-10478'

[
  {
    "page_name": "Franklin-10478",
    "profile": {
      "Id": 20674257,
      "Name": "Franklin-10478",
      "FirstName": "Aretha",
      "MiddleName": "Louise",
      "LastNameAtBirth": "Franklin",
	...
      }
    },
    "status": 0
  }
]

See Examples.

Authentication

Public profiles can be retrieved without any prior authentication using getProfile, getAncestors, etc.. However if you want to retrieve data for a private profile, then you need to first authenticate as a WikiTree.com member. Then you'll be able to retrieve data for any profile which has that member on its Trusted List.

Authentication is a multi-step process in which the editing/viewing user goes to WikiTree.com to provide their credentials and return to the API application with a token. The application can then use the token to validate the user.

Application ID

In order to identify which applications are popular, better manage the resources devoted to the API, and look for places where new API functions might improve app efficiency, API queries accept an optional "appId" parameter. The value has no impact on the results of the query, but is used when the API interaction is logged. App developers are encourged to add an "appId=abc123" parameter to their API queries. The ID can contain letters, digits, underscore, and hyphen. For example:

curl 'https://api.wikitree.com/api.php?action=getProfile&key=Franklin-10478&appId=SpectacularTree'

Complete/Cookbook Examples

Apps.WikiTree.com

Hosting space of user applications

  • on https://apps.wikitree.com/
  • Basic file storage for viewing through web browser
  • SFTP access only (no control panel for files or anything)

About

Documentation and examples for using the WikiTree.com API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published