Developer Relations, Knowledge
https://www.googleapis.com/freebase/v1/search ?query=daft &filter=(all type:/music/musical_group)
{
"status": "200 OK",
"result": [
{
"mid": "/m/016j7m",
"id": "/en/daft_punk",
"name": "Daft Punk",
"notable": {
"name": "Musical Group",
"id": "/music/musical_group"
},
"lang": "en",
"score": 40.160641
},...
],
"cursor": 20,
"cost": 16,
"hits": 78268
}
Simple jQuery widget that can be added to any HTML form.
$(function() {
$("#myinput").suggest({filter:'(all type:/music/musical_group)'});
});
Simple jQuery widget that can be added to any HTML form.
$("#myTags").tagit({ autocomplete: {
source: function( request, response ) {
$.ajax({
url: "https://www.googleapis.com/freebase/v1/search?callback=?",
dataType: "jsonp",
data: { query: request.term,
exact: false,
limit: 6,
prefixed: true
}, success: function( data ) { ... }
})}}});
https://www.googleapis.com/freebase/v1/search? filter=(all type:/film/actor contributed_to:/m/0gtt5fb)
Actors starrring in the movie The Great Gatsby (/m/0gtt5fb)
{
"status": "200 OK",
"result": [
{
"mid": "/m/0dvmd",
"id": "/en/leonardo_dicaprio",
"name": "Leonardo DiCaprio",
"notable": {
"name": "Actor",
"id": "/m/02hrh1q"
},
"lang": "en",
"score": 25.49761
}...
],
"cost": 9,
"hits": 20
}
Simple API call that can display related entities.
$("#myinput").change(function() {
var search_service = 'https://www.googleapis.com/freebase/v1/search';
var params = {
'filter': $('#myinput').val(),
'output': '(description)',
'limit': 7
};
$.getJSON(search_service + '?callback=?', params, function(response) {
for (var i=0; i<response['result'].length; i++) { ... }
});
});
https://www.googleapis.com/freebase/v1/search?filter= (all type:/travel/tourist_attraction (within radius:5000ft lat:48.8656 lon:2.3211))
Tourist attractions within 5000 feet of (48.8656, 2.3211) - Paris
{
"status": "200 OK",
"result": [
{
"mid": "/m/02j81",
"id": "/en/eiffel_tower",
"name": "Eiffel Tower",
"notable": {
"name": "Building",
"id": "/architecture/building"
},
"lang": "en",
"score": 23.409916
}...
],
"cost": 5,
"hits": 10
}
Simple jQuery widget that can be added to any HTML form.
$.getJSON('https://www.googleapis.com/freebase/v1/search?callback=?', {
'filter': '(all (within radius:5000ft lat:48.8656 lon:2.3211))',
'output': '(description geocode)'
}, function(response) {
for (var i=0; i<response['result'].length; i++) {
var result = response['result'][i];
var geolocation = result['output']['geocode']['/location/location/geolocation'][0];
var marker = new google.maps.Marker({
position: new google.maps.LatLng(geolocation['latitude'],
geolocation['longitude']),
map: map,
title: result['name']
})}});
https://www.googleapis.com/freebase/v1/topic/m/0n839? filter=/common/topic/social_media_presence
Social links for Richard Branson (/m/0n839)
https://www.googleapis.com/freebase/v1/topic/m/0n839? filter=/common/topic/topic_equivalent_webpage
Topical links for Richard Branson (/m/0n839)
{
"id": "/m/047v2gm",
"property": {
"/common/topic/social_media_presence": {
"valuetype": "uri",
"values": [
{
"text": "http://plus.google.com/111294603513237625983",
"lang": "",
"value": "http://plus.google.com/111294603513237625983",
"creator": "/user/googlebot",
"timestamp": "2013-04-22T21:21:20.000Z"
}
],
"count": 1
}
}
}
$("#myinput").suggest().bind("fb-select", function(e, data) {
var topic_service = 'https://www.googleapis.com/freebase/v1/topic';
var params = {'filter': '/common/topic'};
$.getJSON(topic_service + data.id + '?callback=?', params, function(topic) {
var weblinks = data.property['/common/topic/social_media_presence']['values'];
for (var i=0; i<weblinks.length; i++) { ... }
});
});
Ask me anything about Freebase and the Knowledge Graph.
Learn how to use the Freebase Search API to find video on YouTube.
View this online at http://goo.gl/PD9Ux