Family Graph API

Getting started

The Family Graph API provides simple access to the core features and data on MyHeritage.com. The API lets developers create applications using the MyHeritage dataset. It presents a simple, consistent view of the data, with uniform representation of the objects in the graph such as users, sites, trees, individuals, photos and sources; and the connections between them including site memberships, family relationships and photo tags.

The Family Graph API is based on the REST architecture and all API calls return JSON objects.

The API currently supports reading information and does not yet support adding, editing and deleting information. These capabilities will be added in the very near future.

Every object in the Family Graph has a unique ID. You can access the properties of an object by requesting it, e.g. https://familygraph.myheritage.com/ID.

Examples:

Sample developer

The ID of the sample developer user is user-10, so you can access this object at https://familygraph.myheritage.com/user-10 (open in browser)
{
"id": "user-10",
"name": "Developer MyHeritage",
"first_name": "Developer",
"last_name": "MyHeritage",
"nickname": "dev",
"gender": "M",
"preferred_display_language": "EN",
"preferred_email_language": "EN",
"link": "http:\/\/www.myheritage.com\/member-10_1\/developer-myheritage",
"birth_date": {
"text": "July 28 1975",
"date": "1975-07-28"
},
"address": "Tilling Road",
"city": "London",
"country_code": "GB",
"zip_code": "NW2 1LJ",
"created_time": "2006-06-26T16:40:50+0000",
"last_visit_time": "2013-04-02T09:47:21+0000",
"is_public": true,
"show_age": true,
"allow_posting_comments": false,
"notify_on_comment": false,
"show_real_name": true,
"personal_photo": {
"id": "photo-0-3-12181762"
},
"default_site": {
"id": "site-144530322",
"name": "Demo Family Site"
},
"default_tree": {
"id": "tree-144530322-1",
"name": "jfk"
},
"default_individual": {
"id": "individual-144530322-1000028",
"name": "Joseph Patrick Kennedy II"
}
}

Sample developer site

The ID of the sample developer site is site-, so you can access this object at https://familygraph.myheritage.com/site-144530322 (open in browser)
{
"id": "site-144530322",
"name": "Demo Family Site",
"description": "Demo family site for developers",
"sub_domain": "demosite",
"link": "http:\/\/www.myheritage.com\/site-144530322\/demo-family-site",
"plan": "basic",
"privacy_policy": "public",
"creator": {
"id": "user-10",
"name": "Developer MyHeritage"
},
"created_date": "2011-03-03",
"plan_expiry_date": "2012-03-03",
"default_tree": {
"id": "tree-144530322-1",
"name": "jfk"
},
"default_root_individual": {
"id": "individual-144530322-1000028",
"name": "Joseph Patrick Kennedy II"
},
"member_count": 1,
"album_count": 6,
"media_count": 305,
"tree_count": 3,
"is_listed_in_site_center": false,
"can_members_edit_trees": true,
"can_members_post_content": true,
"is_request_membership_allowed": true,
"can_members_invite_other_members": true,
"notify_managers_on_membership_request": true
}

Fields

You can also request for specific fields in an object by adding the fields names like this: https://familygraph.myheritage.com/user-10?fields=nickname,gender (open in browser)
{
"id": "user-10",
"name": "Developer MyHeritage",
"nickname": "dev",
"gender": "M"
}

Objects

IDs in the Family Graph consist of a prefix for the type of the object (user, site, photo, etc.) and a unique number within this object type. While the prefixes will remain the same, MyHeritage reserves the right to change the implementation of the numbers in the future so their value cannot be assumed to be fixed over time.

Example of supported objects include:

Connections

All of the objects in the Family Graph are connected to each other via relationships. We refer to those relationships as 'connections' in the API. You can examine the connections between objects using the URL structure https://graph.myheritage.com/ID/CONNECTION_TYPE.

Example of supported connections include:

Returning multiple objects

You can use the ids parameter to list more than one object to return in a single response. For example:
https://familygraph.myheritage.com/?ids=tree-144530322-1,individual-144530322-1000001,individual-144530322-1000002 (open in browser) returns three objects, a tree and two individuals in the same response

Authorization

To access the MyHeritage.com Family Graph API for a certain user, you must first get permission from that user by getting an access token for the user. After you obtain the access token for the user, you can perform authorized requests on behalf of that user by including the access token in your Family Graph API requests:
https://familygraph.myheritage.com/REQUEST?bearer_token=...

The Family Graph API uses OAuth 2.0 for authorization. Please read the authentication guide which provides details of MyHeritage.com OAuth 2.0 implementation, how to request permissions from a user and obtain an access token.

Object model

Below is a list of all object types that are used in the Family Graph API. At the basic level MyHeritage.com includes a list of users and family sites. A user can be a member of several family sites (none, one site or multiple sites) A user can be a manager of the site, which gives this user special administrative privileges in the site, or a regular member in the site. A user who is a member of a site can invite other users to become members of the site.

A family site usually includes a family tree, but it can also include several such trees. A family tree includes a collection of individuals. Individuals in the tree are connected using families - each family can have a husband, a wife and children, though same-gender families are supported too. Information such as names and gender are found in the individuals' objects. Events such as birth and death are found in event objects that are connected to individuals and events such as marriage are found in family events objects that are connected to families. Notes, citations and source can be associated with objects in the family tree.

Media items such as photos, videos, documents and audios can also be part of a family site and can be organized in albums. Individuals in the tree can be tagged in photos.

A Smart Match is a match between two individuals who are thought to be the same person, in two family trees from different family sites.

Object types

  • User
    A user registered in MyHeritage.com. Users are real people with an email address. At the moment, there are more than 72 million such users.
  • Site
    A family site created by a user in order to preserve and share the family history. Other users, typically family relatives, can be invited to be members of the family site. At the moment, there are approx. 18 million family sites.
  • Tree
    A family tree is the core object in a family site that maintains information about the individuals in the family and their relationships.
  • Individual
    An individual (person) in a family tree. An individual may be associated with a user.
  • Family
    A family in a family tree connects between the two spouse (husband and wife individuals) and their children (individuals).
  • Event
    An event of an individual (e.g., birth, death) or a family (e.g., marriage).
  • Note
    A note about an individual, a family, an event or a citation.
  • Album
    An album for organizing media items.
  • Source
    Source of citations used in the family tree, such as a legal document, a book, an interview or a website.
  • Citation
    Citation to a source, about an individual, family, event or note. A citation records where a piece of information about an object in the tree is taken from.
  • Membership
    Information about the membership of a user in a family site.
  • Relationship
    A relationship between two individuals in a family tree.
  • Smart Match
    A match between two individuals in two family trees that are found to be referring to the same person. Smart Matches help users find connections between family trees.

Object diagram

Below is a high level diagram of the different objects and their connections:

documentation
Larger view

Paging

When requesting lists, you can specify which page in the list to return using the offset and limit parameters.

This example requests 2 photos in the album starting with the 5th photo: https://familygraph.myheritage.com/album-144530322-2/media?offset=4&limit=2&fields=name (open in browser)
{
"count": 304,
"paging": {
"previous": "album-144530322-2\/media?offset=2&limit=2&fields=name&lang=EN",
"next": "album-144530322-2\/media?offset=6&limit=2&fields=name&lang=EN"
},
"data": [
{
"id": "photo-144530322-1-1000105",
"name": "Young Jackie"
},
{
"id": "photo-144530322-1-1000106",
"name": "Jackie Kennedy Color Portrait"
}
]
}

Event dates

Dates of events such as birth, death and marriage are returned in the eventdate object. This object has three fields:
  • gedcom - the date of the event encoded in the GEDCOM standard.
  • text - the date of the event formatted in the current language.
  • date - the date of the event encoded in YYYY, YYYY-MM or YYYY-MM-DD format.
Example: https://familygraph.myheritage.com/event-144530322-1000002?fields=date (open in browser)
{
"id": "event-144530322-1000002",
"date": {
"gedcom": "May 29 1917",
"text": "May 29 1917",
"date": "1917-05-29"
}
}

Languages

Data in MyHeritage can be stored in more than one language. For example the first name of an individual can be spelled and saved differently in English and in Russian. By default, data is return in the language of the current user, if there is data in that language for that object. Otherwise, the best matching language is used, based on the character sets of the two languages.

To request for data in a particular language, add the lang=<language_code> parameter to your call.

For example:

SDKs

PHP SDK

The PHP SDK provides Family Graph support for PHP-based web apps. This library can help you add MyHeritage Login and Family Graph API support to your Website.
Download PHP SDK

iOS SDK

The iOS SDK provides Family Graph support for iOS native apps. This library can help you add MyHeritage Login and Family Graph API support to your iOS application.
Download iOS SDK

Android SDK

The Android SDK provides Family Graph support for Android native apps. This library can help you add MyHeritage Login and Family Graph API support to your Android application.
Download Android SDK

Browser

You can use the handy browser application to view the return results and traverse the graph easily.