Andme-apide märkmed loengust

Allikas: Lambda


Check out Use either or both:

  • curl to try the examples out or use the small python code down below to ease experimenting


EMHI example


Example (replace MYTOKEN, you can make it on the docs site or by going to,24.745&radius=1000&&oauth_token=MYTOKEN&v=20141001&limit=50&intent=browse

See foursquare dev docs

Google places

Example (replace MYKEY, you can make it on the docs site),151.1957362&radius=500&types=food&name=harbour&sensor=false&key=MYKEY


Example url from old api, which is no longer functional:

See twitter dev docs and twitter search docs

API testing console:

Google search

Example (sign in to your Google account and read docs about how to create a custom search. Then create a new engine and put its id in place of MYENGINE below. Also replace MYKEY, you can make it on the docs site)

See web search docs and custom-search docs

See also stackoverflow discussion on alternatives

Facebook graph api

Quick example:,name&access_token=MY_TOKEN

you can get MY_TOKEN from several places, for example:

Check also non-api scraping:

Python example for experimenting


from math import *
import os
import urllib2
import json
import xml.dom.minidom

# NB! Replace YOURKEY and YOURTOKEN below with a key and token you make yourself
# on the corresponding api doc page


def main():
  #print data
  print json.dumps(data, sort_keys=True, indent=2)

def main2():
  print "headers:\n"
  for e in h: print e,    
  print "\ndata:\n"
  print json.dumps(data, sort_keys=True, indent=2)


Microsoft Open Data web api standard