GeoNames Home | Postal Codes | Download / Webservice | About |
search

Wikipedia Webservice

The wikipedia webservices give access to georeferenced wikipedia articles in 240 languages. For the largest languages (English, German, French, Spanish, Italian, Portuguese, Polish, Russian and Chinese) full text and a summary is also available.


Wikipedia Attributes (XML or JSON):

AttributeDescription
langISO language code of article text
titlethe article title
summarya short summary of the article text. Around 300 chars. The text is truncated at a full stop if one is available near char 300, otherwise at the end of a word.
featurethe wikipedia feature type. A list of types is available here
countryCodethe ISO country code of the article
elevationthe elevation in metres (optional may be null), parsed from the article or reverse geocoded.
populationthe population (optional may be null)
latlatitude
lnglongitude
wikipediaUrlURL of the article
thumbnailImgURL of a small thumbnail image (ca 100x75 px)
rankindication of the popularity or relevancy of an article. The rank is an integer number from 1 for the least popular articles to 100 for the most popular articles. It is calculated from the number of links pointing to an article and the article length. The articles are more or less evenly distributed over the 100 ranks.


Find nearby Wikipedia Entries / reverse geocoding
This service comes in two flavors. You can either pass the lat/long or a postalcode/placename.

Webservice Type : XML,JSON or RSS
Url : api.geonames.org/findNearbyWikipedia?
api.geonames.org/findNearbyWikipediaJSON?
api.geonames.org/findNearbyWikipediaRSS?
Parameters :
lang : language code (around 240 languages) (default = en)
lat,lng, radius (in km), maxRows (default = 5),country (default = all countries)
or
postalcode,country, radius (in Km, default 10km, max limit for free service 20km, max limit for premium 150km), maxRows (default = 5, max for free service 500, max for premium service 2000)
for premium users: length of the full text.
Result : returns a list of wikipedia entries as xml document
Example:
http://api.geonames.org/findNearbyWikipedia?lat=47&lng=9&username=demo
or
api.geonames.org/findNearbyWikipedia?postalcode=8775&country=CH&radius=10&username=demo

[more reverse geocoding]



Wikipedia Fulltext Search
Webservice Type : XML or JSON
Url : api.geonames.org/wikipediaSearch?
api.geonames.org/wikipediaSearchJSON?
Parameters : q : place name (urlencoded utf8)
title : search in the wikipedia title (optional)
lang : language code, supported languages are de,en,es,fr,it,nl,pl,pt,ru,zh (default = en)
maxRows : maximal number of rows returned (default = 10)
Result : returns the wikipedia entries found for the searchterm as xml document
Example http://api.geonames.org/wikipediaSearch?q=london&maxRows=10&username=demo



Wikipedia Articles in Bounding Box
Webservice Type : XML or JSON
Url : api.geonames.org/wikipediaBoundingBox?
api.geonames.org/wikipediaBoundingBoxJSON?
Parameters : south,north,east, west : coordinates of bounding box
lang : language code, supported languages are de,en,es,fr,it,nl,pl,pt,ru,zh (default = en)
maxRows : maximal number of rows returned (default = 10)
Result : returns the wikipedia entries within the bounding box as xml document
Example http://api.geonames.org/wikipediaBoundingBox?north=44.1&south=-9.9&east=-22.4&west=55.2&username=demo



Note : Don't forget to url encode string parameters containing special characters or spaces. (Faq entry on url encoding)





Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.

Wikipedia texts are licenced under Creative Commons Attribution-ShareAlike 3.0 Unported License.