1. Better Genealogy
Through APIs
Michael Berkovich
Platform Tech Lead, Geni.com
michael@geni.com
February 2, 2012
Thursday, February 2, 12
2. The Brief History of The Web
Web 1.0
1990-2004
Static Content
Publishing, Sharing, Surfing, Email, Chat, CMS, Personal
Websites, Screen Scraping
Delivered Through
HTTP, HTML, URL, Dialup
Thursday, February 2, 12
3. The Brief History of The Web
Web 2.0
2004-2008
Social Web and User Provided Content
Community, Collaboration, Interaction, Participation,
Blogging, Wikis, Tagging, Syndication, SEO
Delivered Through
DHTML, CSS, JavaScript, AJAX, JSON, XML, XSLT, XHTML,
XMLHttpRequest, Prototype, jQuery, RSS
Thursday, February 2, 12
4. The Brief History of The Web
Web 2.0 ++
2008 - now
Integrated Data
Web Services, Platforms, Mashups, Cloud, SaaS, Mobile Apps
Delivered Through
API, SOA, REST, SOAP, OAuth, RSS
Thursday, February 2, 12
5. What is an API?
n Application Programming Interface
n Set of protocols that provide building blocks for
developers to build applications
n Previously were associated with computer
operating systems and native applications
n Today mostly refer to web services
Thursday, February 2, 12
6. What is a Web Service API?
Client Applications (Web, Mobile, Desktop) n Request messages along with a
definition of the structure of
response messages
HTTP
HTTPS
Client-Side SDKs n Data formats - JSON, XML
JS, iOS, Android, Java
XML
JSON
n Paradigms - REST, SOAP
Web Services Layer
n Protocols - HTTP, HTTPS
Family Tree Records Media
API API API
Core Platform and Data
Thursday, February 2, 12
7. Total API Over Time
Programmable Web Statistics
Source: http://net.tutsplus.com/articles/news/the-increasing-importance-of-apis-in-web-development/
Thursday, February 2, 12
8. Consumer API Categories
Programmable Web Statistics
Source: http://net.tutsplus.com/articles/news/the-increasing-importance-of-apis-in-web-development/
Thursday, February 2, 12
9. Mashups Created in the Last 6 Months
Programmable Web Statistics
Source: http://www.programmableweb.com
Thursday, February 2, 12
10. Benefits of Web APIs
End Users
n Provides users with application choices and
better tools
Application Developers
n Allows unique and creative integration to
provide the best value to the end users
API Providers
n Increases interest in the products and services
n Increases web traffic
n Outsources a task that is not part of your core
business
Thursday, February 2, 12
11. Genealogy Applications Today
Documents & Records
Maps
Biographies
Family Tree
Family Photos
DNA Services
Charts
Thursday, February 2, 12
12. Genealogy Applications with API
Documents & Records Biographies
Maps
Family Photos
Genealogy Platform
DNA Services Charts
Thursday, February 2, 12
13. Why Genealogy API?
n Save users time
n Provides access to the best tools
n Allows for data aggregation
n Makes collaboration easy
n Enables integrated experience
Thursday, February 2, 12
14. APIs in Genealogy
Geni API
http://dev.geni.com
MyHeritage Family Graph API
http://www.familygraph.com
FamilySearch API
https://devnet.familysearch.org/docs/api-overview
Thursday, February 2, 12
15. Geni Platform Features
n Free public open API that provides access to Geni
users and data
n Application security and permissions
n API management and documentation
n Developer tools, SDKs and metrics
n Application directory
Thursday, February 2, 12
16. What Can You Do With Geni Platform?
n Geni Connect and Web Widgets
n Web, Mobile and Desktop
applications
n Embedded apps within Geni
Thursday, February 2, 12
18. What is OAuth?
An open protocol to allow secure API
authorization in a simple and standard
method from desktop and web applications.
Source: http://oauth.net
Thursday, February 2, 12
19. Who is Using OAuth?
Source: http://oauthx.com
Thursday, February 2, 12
20. OAuth 2.0
n Consumers
n Desktop and mobile applications
n Dashboard widgets and gadgets
n Javascript browser-based apps
n Providers (platform)
n Web applications and server-side API
Thursday, February 2, 12
21. OAuth 2.0 - High Level
User
Web Authorization
Browser Server
Shared
Authorization
Store
Client Resource
Application Server
Thursday, February 2, 12
25. API Access Scope & Permissions
User Family Tree
user_basic family_basic tree_basic
user_email X X
user_location family_location tree_location
user_about_me family_about_me tree_about_me
user_occupation family_occupation tree_occupation
user_events family_events tree_events
user_contact_info family_contact_info X
user_media family_media tree_media
update_user X update_profiles
publish_media
upload
tag
comment
Thursday, February 2, 12
26. RESTFul Paradigm
http://www.geni.com/api/user
http://www.geni.com/api/profile/12345
http://www.geni.com/api/profile/12345/immediate-family
n REpresentational State Transfer
n Stateless client-server architecture
n Web services are resources and can be identified
by their URLs
n API is defined as set of remote methods that
describe the action to be performed on the
resource
n HTTP methods such as GET and POST are used to
describe the necessary CRUD actions to be
performed
Thursday, February 2, 12
27. JSON Data Format
{
“first_name”: “Michael”,
“last_name”: “Berkovich”,
“gender”: “male”,
“email”: “michael@geni.com”
}
n JavaScript Object Notation
n Lightweight data-interchange format
n Easy for humans to read and write
n Easy for machines to parse and generate
n Based on a subset of the JavaScript Programming
Language
n Completely language independent
Thursday, February 2, 12
28. Geni Platform Client SDKs
n JavaScript SDK
n http://geni.com/jsdk.js
n iOS SDK
n https://github.com/geni/geni-ios-sdk
n Android SDK (work in progress)
n Java SDK (work in progress)
n PHP SDK (work in progress)
Thursday, February 2, 12
30. Profile API Example
http://www.geni.com/api/profile-23642470
Thursday, February 2, 12
31. Immediate Family API Example
http://www.geni.com/api/profile-23642470/immediate-family
Thursday, February 2, 12
32. Profiles and Unions
http://www.geni.com/api/profile-23642470/immediate-family
Thursday, February 2, 12
33. Profile Documents API Example
http://www.geni.com/api/profile-23642470/documents
Thursday, February 2, 12
34. Geni JavaScript SDK Example
Include Geni JS Client SDK Script
<script src="http://geni.com/jsdk.js"></script>
Initialize Geni Client
Geni.init({
app_id: 'YOUR_APP_KEY',
cookie: true, // enables saving the access token to a cookie
logging:true // enable log messages to help in debugging
});
Connect with Geni
Geni.connect(function(response) {
if(response.status == 'authorized') {
// User is logged in and has authorized your application.
// You can now make authorized calls to the API.
} else {
// User is either logged out, has not authorized the app or both.
}
});
Call Geni API
Geni.api('/profile-23642470', function(response) {
alert(response.name)
});
Thursday, February 2, 12
37. Geni Developer Community
Over 200 developers are working on more than 70 Geni Apps
Thursday, February 2, 12
38. Why Develop with Geni Platform?
n Instant access to our Free Public Open API
n Reach over 7 million users
n Get access to over 115 million profiles
n Access public content including historical profiles,
family trees, genealogy projects and surnames
Thursday, February 2, 12
39. Getting Started with Geni Platform
http://dev.geni.com
n Register as a developer
n Create a new application
n Use key and secret to get an access token
n Use Geni’s API to create an amazing user
experience
n Publish your application in the application
directory
Thursday, February 2, 12
40. And One More Thing
Geni platform is Open-Sourced!
http://github.com/berk/platform
Thursday, February 2, 12