Geograph API v0.81

Contents

Geograph's Application Programming Interface (API) allows third party developers to create applications using data sourced from Geograph, in a friendly and polite way.

Chances are you have come to this page because you are a developer looking to get access to some of the data, well you've come to the right place, below you will find brief details of what's available and how to get it...

Please note that the API is still in its early stages, these are the possiblities that the developers needed, or felt would be useful, if you have any special requests then don't be shy, just let us know.

Google Groups Beta Subscribe to Geograph-API-Users
Email:
Recommended, API updates will be posted here.
Low traffic, membership list is not disclosed.
Modify Each of these Feeds includes the photographer credit/name, which under the CC licence MUST be displayed along any use of the image. Also the fact the image is CC licenced needs to be mentioned.

Ideally also you could link back to the main photo page, either with the link supplied or with http://geo.hlipp.de/photo/[id].

Thank you for your attention in this matter.

Torrents - Bulk Image download

The entire (or at least it will be) archive is available for download via bittorrent - see http://torrents.geograph.org.ukExternal link for details.

API-key

If you haven't got one you will need to obtain a unique API-key, which gives you access to the pages below, simply contact us, with a brief outline of your project, please include the URL so we can take a look.

Once you have a API-key simply replace [apikey] in the examples below to obtain your feed.

RSS-feeds RSS

Really Simple Syndication allows you to obtain a details for a number of images, (usually) in XML format, this makes it really easy for you to reuse small section of information on your website or project. The feed lives at

http://geo.hlipp.de/syndicator.php?key=[apikey]

and by default returns obtains an up-to-date listing of the 20 latest geograph submissions, you can however return different results as below

Feed Type

You should supply one of the following parameters to specify the type of results you would like...

-none- 20 latest geograph submissions
http://geo.hlipp.de/syndicator.php?key=[apikey]
i=[searchid] runs a predefined search, see Building a Search Query for more information on how to obtain a valid i number. accepts additonal paramater:
page=[number] return a specific page of results
http://geo.hlipp.de/syndicator.php?key=[apikey]&i=12345
u=[user_id] limit results to particular user
http://geo.hlipp.de/syndicator.php?key=[apikey]&u=3
q=[query] Tries deduce the type of search, either a text or a location search. can use the format q={what}+near+{where} to be sure (or use seperate params as below) - Will in fact create a i query on the fly, so you can use that to get page 2 etc of the results. Accepts additonal paramater:
u=[user_id] limit results to particular user
http://geo.hlipp.de/syndicator.php?key=[apikey]&q=bridge+near+TQ7054
location=[location] Returns 15 or all within 10km (which ever is less) of the specified location (Grid Reference, Postcode or Decimal Lat/Long) (see also Building a query for pitfals of the q paramater) - Will in fact create a i query on the fly, so you can use that to get page 2 etc of the results. Accepts additonal paramater:
text=[text string] returns only images matching this text search
u=[user_id] limit results to particular user
http://geo.hlipp.de/syndicator.php?key=[apikey]&location=TQ7054
text=[text string] Returns 15 results matching the word search - Will in fact create a i query on the fly, so you can use that to get page 2 etc of the results. Accepts additonal paramater:
u=[user_id] limit results to particular user
http://geo.hlipp.de/syndicator.php?key=[apikey]&text=bridge

Options

expand=1 If present includes the thumbnail of the image in the description as html. (non applicable to KML format)
http://geo.hlipp.de/syndicator.php?key=[apikey]&expand=1

Formats

There is a number of standard formats the feed is available in

format=RSS0.91 RSS 0.91
format=RSS1.0 RSS 1.0
format=RSS2.0 RSS 2.0
format=GeoRSS GeoRSS - Default - Extension of RSS 1.0 to include the lat/long, see georss.orgExternal link
format=GeoPhotoRSS GeoPhotoRSS - Further custom extension of GeoRSS to also include the thumbnail url, see pheed.comExternal link
format=GPX GPX 1.0 - the GPS Exchange Format, see topografix.comExternal link
format=OPML OPML
format=HTML HTML - ideal to be output by a server side script or to be included in an IFRAME
format=JS JavaScript - ideal to output a simple table with a single <SCRIPT> tag
<script src="http://geo.hlipp.de/syndicator.php?key=[apikey]&format=JS" type="text/javascript"></script>
format=PHP PHP - returns a valid php page, that builds a data-structure for use via include. (includes the thumbnail url)
format=KML KML - suitable for use directly in Google Earth (XML based - includes the thumb url and lat/long!)
accepts additonal paramaters:
simple=1 If present includes styling to hide the picture label unless hovering over the photo (recommended!)

REST interface

Provides a very simple interface for obtaining details about a particular image or grid square. Will later be extended to include contributors, and tags, and possibly even hectads and myriads and some aggregate statistics. If looking for bulk downloads please consider one of the alternative means.

Services

http://geo.hlipp.de/api/photo/[photo-id]/[apikey]
Photo Details Returns an XML infoset about the particular photograph, currently returns:
<?xml version="1.0" encoding="UTF-8" ?> 
<geograph>
  <status state="ok" /> 
  <title>Bascote</title> 
  <gridref>SP4063</gridref> 
  <user profile="http://geo.hlipp.de/profile/120">David Stowell</user> 
  <img src="http://geo.hlipp.de/photos/00/34/003456_e10e23bc.jpg"
     width="640" height="480" /> 
</geograph>
http://geo.hlipp.de/api/Gridref/[4fig gridref]/[apikey]
Grid Square Details Returns an XML infoset about the particular square, currently returns:
<?xml version="1.0" encoding="UTF-8" ?> 
<geograph>
  <status state="ok" count="1" /> 
  <image url="http://geo.hlipp.de/photo/64854">
    <title>Afon Cynfal</title> 
    <user profile="http://geo.hlipp.de/profile/3">Barry Hunter</user> 
    <img src="http://geo.hlipp.de/photos/06/48/064854_d68e7342_120x120.jpg" width="90" height="120" /> 
    <location grid="1" eastings="270500" northings="341100" /> 
  </image>
</geograph>
http://geo.hlipp.de/photo/[photo-id].rdf
http://geo.hlipp.de/photo/[photo-id].kml

CSV Export

Modify Note, that these CSV exports have become very inefficient, and so will only return 1000 records without prior arrangement.

This is ideal for bulk downloads, or for keeping an offsite cache up-to-date, it lives at:

http://geo.hlipp.de/export.csv.php?key=[apikey]

but works best in combination with the parameters below.

Parameters

-none- returns the whole database, this should only be used for an initial download, then use one of the following methods to just return a subset
http://geo.hlipp.de/export.csv.php?key=[apikey]
since=[date] Returns all images submitted or modified* on or after this date. Date is in YYYY-MM-DD format.
This is the preferred method, where you simply need to keep track of the day you last checked.
http://geo.hlipp.de/export.csv.php?key=[apikey]&since=2005-07-01
last=[number]+[interval] Returns all images submitted or modified* during the period specified.
Valid formats for [interval] MINUTE WEEK
HOUR MONTH
DAY YEAR
http://geo.hlipp.de/export.csv.php?key=[apikey]&last=7+DAY
http://geo.hlipp.de/export.csv.php?key=[apikey]&last=6+HOUR
limit=[number] Returns the latest [number] images submitted or modified* (also happens to be in descending date order)
http://geo.hlipp.de/export.csv.php?key=[apikey]&limit=30
ri=[1|2] Limit the results to a particular National Grid
(can be combined with the above parameters)
http://geo.hlipp.de/export.csv.php?key=[apikey]&ri=1 - Great Britain
http://geo.hlipp.de/export.csv.php?key=[apikey]&ri=2 - Ireland
i=[searchid] runs a predefined search, see Building a Search Query for more information on how to obtain a valid i number.
NOTE: can't be combined with any of the above paramaters, but accepts additonal paramaters:
count=[number] overrides the pagesize specified in the query,
or -1 for unlimited
page=[number] return a specific page of results
(paginated with the modified 'count')
http://geo.hlipp.de/export.csv.php?key=[apikey]&i=12345

* because these results also return images modified within the period its possible you will receive updates to images you already have. You can safely use the ID column to check for duplicates. the modified date is changed when anything about the image changes, for example of the title or comment, its possible you will get a row that nothing has apparentlly changed, but these should be very few.

Columns

Id Unique Numeric ID for the Picture,
to be used to construct the URL to link back to the image
http://geo.hlipp.de/photo/2345
2345
Name Plain text title for the image Newbury High Street
Grid Ref Four Figure Grid Reference for the image TQ6046 or B5467
Submitter Full name of the submitter of the image, to be used for credit Fred Bloggs
Image Class Plain text image category Village Scene

Returning Extra Columns

NOTE: You can only supply EITHER en OR ll, not both

&en=1 add this parameter to add the Eastings, Northings and Precision
http://geo.hlipp.de/export.csv.php?key=[apikey]&en=1
  Easting Absolute position for the image in m from the Grid False origin. Use the Grid Ref column to deduce with Grid the location refers to. These columns will be 0 when the image isn't positioned with more than a 4 figure Grid Reference. New! include &coords=1 to get eastings/northings even for 4fig References 545667
Northing 234556
Figures 10
&ll=1 add this parameter to return the WGS84 Latitude and Longitude
Lat Position for the image in decimal degrees lat/long, negative Longitude is West, specified to as high as accuracy as possible. 53.5564
Long -2.5466
&thumb=1 add this parameter to return the full url to a 120x120 pixel thumbnail
  Thumb URL Example:
http://geo.hlipp.de/photos/01/76/017622_ed5d17d5_120x120.jpg
&ppos=1 add this parameter to add the Eastings, Northings and Precision of the Photographer Position
http://geo.hlipp.de/export.csv.php?key=[apikey]&ppos=1
  Easting Absolute position for the photographer in m from the Grid False origin. Use the Grid Ref column to deduce with Grid the location refers to. These columns will be 0 when the image doesnt include a Photographer Grid Reference 545667
Northing 234556
Figures 10

Building a Search Query

There are there main methods for obtaining some valid i numbers for passing to the RSS or CSV feeds (or in fact directing the user to a search results page!).

TIP: where ever you pass a i parameter you can also pass a page parameter to return another page of results. eg http://geo.hlipp.de/syndicator.php?key=[apikey]&i=12345&page=2

Predefined Searches Perhaps the simplest way is just to use one of our predefined searches
25654 15 Random images, by users joined in the last week
29439 50 Recently submitted images
25678 15 Random images from 15 categories
26586 15 Random first geographs for 15 squares
25666 15 Random images specified to a 10 figure grid reference
Location String (Postcode, Grid Reference or Lat/Long) Simply pass to search.php and the response from the server will include a brand new i number ready for use.

For example http://geo.hlipp.de/search.php?q=SH3467 would return a
Location: http://geo.hlipp.de/search.php?i=12345
header, just parse out that i number and pass it to the XML/CSV page.

UK(inc NI) Postcodes, e.g.
http://geo.hlipp.de/search.php?q=TN32+3DZ

Lat/Long (Decimal Degrees only), example http://geo.hlipp.de/search.php?q=52.332,-2.2345

Technically this can also accept place-names or free text search, however due to there being no guarantee that it will only match one place-name (or none and run a text search), if its not sure the it returns a page asking the user to confirm their meaning.

However its possible to pass a numeric place-name id, please contact us if you would be interested in a copy of the dataset that we use.
Advanced Its also possible to build more complicated searches using the advanced search form. Either build a search using the form and make note of the resultant i number, or have a look at the source code to see the parameters possible.

Due to fact that the exact parameters are subject to change and have some inter-relations, it's probably easiest to contact us with the details of the type of searches you are trying to build.

Places to use an i number

Each one accepts the Page paramater, to get the next page of results.

Results Webpage http://geo.hlipp.de/search.php?i=12345
Google Earth Webpage http://geo.hlipp.de/kml.php?i=12345
Statistics Webpage http://geo.hlipp.de/statistics/breakdown.php?i=12345
XML/HTML etc feed http://geo.hlipp.de/syndicator.php?key=[apikey]&i=12345
CSV feed http://geo.hlipp.de/export.csv.php?key=[apikey]&i=12345
MemoryMap feed http://geo.hlipp.de/memorymap.php?key=[apikey]&i=12345 (Coming soon)
GPX Export http://geo.hlipp.de/syndicator.php?key=[apikey]&format=GPX&i=12345

Other Ways to download information

Finally

We wish you luck in you project and look forward to seeing the results! If you have any problems using the API, then please do get in contact, or join the Geograph-API-Users Google Discussion Group.

Nicht angemeldet: Anmelden | Registrieren  [de|en]