API Documentation

See the OSM wiki for general information about the API.

Also show deprecated API calls

Table of Contents

/api/4/josm/style/image

Path: /api/4/josm/style/image
Description: Access images for map features used in JOSM.
Parameters: image — Image path (required).
style — JOSM style (required).
Paging: no
Filter: none
Sort: none
Result: PNG image.
Example: /api/4/josm/style/image?style=standard&image=transport/bus.png
UI Example: /keys/landuse#josm

/api/4/josm/style/rules

Path: /api/4/josm/style/rules
Description: List rules and symbols in JOSM styles.
Parameters: query — Only show results where the key or value matches this query (substring match, optional).
style — JOSM style (required).
Paging: optional
Filter: none
Sort: none
Result:
total:INTTotal number of results.
page:INTResult page number (first has page number 1).
rp:INTResults per page.
data:ARRAY OF HASHESArray with results.
    key:STRINGKey
    value:STRINGValue
    value_bool:STRING"yes" or "no". Null if the value is not boolean.
    rule:STRINGJOSM style rule in XML format.
    area_color:STRINGFill color for area (if area rule).
    line_color:STRINGStroke color for line (if line rule).
    line_width:INTLine width (if line rule).
    icon:STRINGIcon path (if icon rule).
Example: /api/4/josm/style/rules?style=standard&page=1&rp=10
UI Example: /reports/josm_styles

/api/4/key/combinations

Path: /api/4/key/combinations
Description: Find keys that are used together with a given key.
Parameters: key — Tag key (required).
query — Only show results where the other_key matches this query (substring match, optional).
Paging: optional
Filter: all — No filter.
nodes — Only values on tags used on nodes.
relations — Only values on tags used on relations.
ways — Only values on tags used on ways.
Sort: together_count, other_key, from_fraction
Result:
total:INTTotal number of results.
page:INTResult page number (first has page number 1).
rp:INTResults per page.
data:ARRAY OF HASHESArray with results.
    other_key:STRINGOther key.
    together_count:INTNumber of objects that have both keys.
    to_fraction:FLOATFraction of objects with this key that also have the other key.
    from_fraction:FLOATFraction of objects with other key that also have this key.
Example: /api/4/key/combinations?key=highway&page=1&rp=10&sortname=together_count&sortorder=desc
UI Example: /keys/highway#combinations

/api/4/key/distribution/nodes

Path: /api/4/key/distribution/nodes
Description: Get map with distribution of this key in the database (nodes only).
Parameters: key — Tag key (required).
Paging: no
Filter: none
Sort: none
Result: PNG image.
Example: /api/4/key/distribution/nodes?key=amenity
UI Example: /keys/amenity#map

/api/4/key/distribution/ways

Path: /api/4/key/distribution/ways
Description: Get map with distribution of this key in the database (ways only).
Parameters: key — Tag key (required).
Paging: no
Filter: none
Sort: none
Result: PNG image.
Example: /api/4/key/distribution/ways?key=highway
UI Example: /keys/highway#map

/api/4/key/josm/style/rules

Path: /api/4/key/josm/style/rules
Description: List rules and symbols for the given key in JOSM styles.
Parameters: key — Tag key (required).
query — Only show results where the value matches this query (substring match, optional).
style — JOSM style (required).
Paging: optional
Filter: none
Sort: none
Result:
total:INTTotal number of results.
page:INTResult page number (first has page number 1).
rp:INTResults per page.
data:ARRAY OF HASHESArray with results.
    key:STRINGKey
    value:STRINGValue
    value_bool:STRING"yes" or "no". Null if the value is not boolean.
    rule:STRINGJOSM style rule in XML format.
    area_color:STRINGFill color for area (if area rule).
    line_color:STRINGStroke color for line (if line rule).
    line_width:INTLine width (if line rule).
    icon:STRINGIcon path (if icon rule).
Example: /api/4/key/josm/style/rules?style=standard&key=highway&page=1&rp=10
UI Example: /keys/highway#josm

/api/4/key/stats

Path: /api/4/key/stats
Description: Show some database statistics for given key.
Parameters: key — Tag key (required).
Paging: no
Filter: none
Sort: none
Result:
total:INTTotal number of results.
data:ARRAY OF HASHESArray with results.
    type:STRINGObject type ("all", "nodes", "ways", or "relations")
    count:INTNumber of objects with this type and key.
    count_fraction:FLOATNumber of objects in relation to all objects.
    values:INTNumber of different values for this key.
Example: /api/4/key/stats?key=amenity
UI Example: /keys/amenity#overview

/api/4/key/values

Path: /api/4/key/values
Description: Get values used with a given key.
Parameters: key — Tag key (required).
lang — Language for description (optional, default: 'en').
query — Only show results where the value matches this query (substring match, optional).
Paging: optional
Filter: all — No filter.
nodes — Only values on tags used on nodes.
relations — Only values on tags used on relations.
ways — Only values on tags used on ways.
Sort: value, count_all, count_nodes, count_ways, count_relations, in_wiki
Result:
total:INTTotal number of results.
page:INTResult page number (first has page number 1).
rp:INTResults per page.
data:ARRAY OF HASHESArray with results.
    value:STRINGValue
    count:INTNumber of times this key/value is in the OSM database.
    fraction:FLOATNumber of times in relation to number of times this key is in the OSM database.
    in_wiki:BOOLIs there at least one wiki page for this tag.
    description:STRINGDescription of the tag from the wiki.
Example: /api/4/key/values?key=highway&page=1&rp=10&sortname=count_ways&sortorder=desc
UI Example: /keys/highway#values

/api/4/key/wiki_pages

Path: /api/4/key/wiki_pages
Description: Get list of wiki pages in different languages describing a key.
Parameters: key — Tag key (required)
Paging: no
Filter: none
Sort: none
Result:
total:INTTotal number of results.
data:ARRAY OF HASHESArray with results.
    lang:STRINGLanguage code.
    language:STRINGLanguage name in its language.
    language_en:STRINGLanguage name in English.
    title:STRINGWiki page title.
    description:STRINGShort description of key from wiki page.
    image:HASHAssociated image.
        title:STRINGWiki page title of associated image.
        width:INTWidth of image.
        height:INTHeight of image.
        mime:STRINGMIME type of image.
        image_url:STRINGImage URL
        thumb_url_prefix:STRINGPrefix of thumbnail URL.
        thumb_url_suffix:STRINGSuffix of thumbnail URL.
    on_node:BOOLIs this a key for nodes?
    on_way:BOOLIs this a key for ways?
    on_area:BOOLIs this a key for areas?
    on_relation:BOOLIs this a key for relations?
    tags_implies:ARRAY OF STRINGSList of keys/tags implied by this key.
    tags_combination:ARRAY OF STRINGSList of keys/tags that can be combined with this key.
    tags_linked:ARRAY OF STRINGSList of keys/tags related to this key.
Example: /api/4/key/wiki_pages?key=highway
UI Example: /keys/highway#wiki
Notes: To get the complete thumbnail image URL, concatenate thumb_url_prefix, width of image in pixels, and thumb_url_suffix. The thumbnail image width must be smaller than width, use the image_url otherwise.

/api/4/keys/all

Path: /api/4/keys/all
Description: Get list of all keys.
Parameters: query — Only show keys matching this query (substring match, optional).
Paging: optional
Filter: characters_problematic — Only show keys with problematic characters.
characters_space — Only show keys with spaces.
in_wiki — Only show keys that appear in the wiki.
not_in_db — Only show keys that do not appear in the database.
Sort: key, count_all, count_nodes, count_ways, count_relations, values_all, users_all, in_wiki, in_josm, in_potlatch, length
Result:
total:INTTotal number of results.
page:INTResult page number (first has page number 1).
rp:INTResults per page.
data:ARRAY OF HASHESArray with results.
    key:STRINGKey
    count_all:INTNumber of objects in the OSM database with this key.
    count_all_fraction:FLOATNumber of objects in relation to all objects.
    count_nodes:INTNumber of nodes in the OSM database with this key.
    count_nodes_fraction:FLOATNumber of nodes in relation to all tagged nodes.
    count_ways:INTNumber of ways in the OSM database with this key.
    count_ways_fraction:FLOATNumber of ways in relation to all ways.
    count_relations:INTNumber of relations in the OSM database with this key.
    count_relations_fraction:FLOATNumber of relations in relation to all relations.
    values_all:INTNumber of different values for this key.
    users_all:INTNumber of users owning objects with this key.
    in_wiki:BOOLHas this key at least one wiki page?
    in_josm:BOOLIs this key referenced in at least one JOSM style rule?
Example: /api/4/keys/all?page=1&rp=10&filter=in_wiki&sortname=key&sortorder=asc
UI Example: /keys

/api/4/keys/wiki_pages

Path: /api/4/keys/wiki_pages
Description: Get list of wiki pages in different languages for all keys.
Parameters: query — Only show keys matching this query (substring match, optional).
Paging: optional
Filter: none
Sort: key
Result:
total:INTTotal number of results.
page:INTResult page number (first has page number 1).
rp:INTResults per page.
data:ARRAY OF HASHESArray with results.
    key:STRINGKey
    lang:HASHHash with language codes as keys and values showing what type of wiki pages are available.
Example: /api/4/keys/wiki_pages?page=1&rp=10&sortname=key&sortorder=asc
UI Example: /reports/language_comparison_table_for_keys_in_the_wiki

/api/4/keys/without_wiki_page

Path: /api/4/keys/without_wiki_page
Description: Return frequently used tag keys that have no associated wiki page.
Parameters: english — Check for key wiki pages in any language (0, default) or in the English language (1).
min_count — How many tags with this key must there be at least to show up here? (default 10000).
query — Only show results where the key matches this query (substring match, optional).
Paging: optional
Filter: none
Sort: key, count_all, values_all, users_all
Result:
total:INTTotal number of results.
page:INTResult page number (first has page number 1).
rp:INTResults per page.
data:ARRAY OF HASHESArray with results.
    key:STRINGKey
    count_all:INTNumber of objects in database with this key.
    count_all_fraction:FLOATFraction of objects in database with this key.
    values_all:INTNumber of different values for this key.
    users_all:INTNumber of different users who own objects with this key.
    prevalent_values:HASHOften used values.
        value:STRINGValue
        count:INTNumber of occurances of this value.
        fraction:FLOATFraction of all values.
Example: /api/4/keys/without_wiki_page?min_count=1000&english=1&page=1&rp=10&sortname=count_all&sortorder=desc
UI Example: /reports/frequently_used_keys_without_wiki_page

/api/4/relation/roles

Path: /api/4/relation/roles
Description: Member role statistics for a relation of given type.
Parameters: query — Only show results where the role matches this query (substring match, optional).
rtype — Relation type (required).
Paging: optional
Filter: none
Sort: role, count_all_members, count_node_members, count_way_members, count_relation_members
Result:
total:INTTotal number of results.
page:INTResult page number (first has page number 1).
rp:INTResults per page.
data:ARRAY OF HASHESArray with results.
    rtype:STRINGRelation type
    role:STRINGRelation member role.
    count_all_members:INTNumber of members with this role.
    count_all_members_fraction:FLOATNumber of members with this role devided by all members.
    count_node_members:INTNumber of members of type node with this role.
    count_node_members_fraction:FLOATNumber of members of type node with this role devided by all members of type node.
    count_way_members:INTNumber of members of type way with this role.
    count_way_members_fraction:FLOATNumber of members of type way with this role devided by all members of type way.
    count_relation_members:INTNumber of members of type relation with this role.
    count_relation_members_fraction:FLOATNumber of members of type relation with this role devided by all members of type relation.
Example: /api/4/relation/roles?rtype=multipolygon&page=1&rp=10
UI Example: /relations/multipolygon#roles

/api/4/relation/stats

Path: /api/4/relation/stats
Description: Show some database statistics for given relation type.
Parameters: rtype — Relation type (required).
Paging: no
Filter: none
Sort: none
Result:
total:INTTotal number of results.
data:ARRAY OF HASHESArray with results.
    type:STRINGMember type ("all", "nodes", "ways", or "relations")
    count:INTNumber of members with this type.
Example: /api/4/relation/stats?rtype=multipolygon
UI Example: /relations/multipolygon#overview

/api/4/relation/wiki_pages

Path: /api/4/relation/wiki_pages
Description: Get list of wiki pages in different languages describing a relation type.
Parameters: rtype — Relation type (required)
Paging: no
Filter: none
Sort: none
Result:
total:INTTotal number of results.
data:ARRAY OF HASHESArray with results.
    lang:STRINGLanguage code.
    language:STRINGLanguage name in its language.
    language_en:STRINGLanguage name in English.
    title:STRINGWiki page title.
    description:STRINGShort description of key from wiki page.
    image:HASHAssociated image.
        title:STRINGWiki page title of associated image.
        width:INTWidth of image.
        height:INTHeight of image.
        mime:STRINGMIME type of image.
        image_url:STRINGImage URL
        thumb_url_prefix:STRINGPrefix of thumbnail URL.
        thumb_url_suffix:STRINGSuffix of thumbnail URL.
Example: /api/4/relation/wiki_pages?rtype=multipolygon
UI Example: /relations/multipolygon#wiki
Notes: To get the complete thumbnail image URL, concatenate thumb_url_prefix, width of image in pixels, and thumb_url_suffix. The thumbnail image width must be smaller than width, use the image_url otherwise.

/api/4/relations/all

Path: /api/4/relations/all
Description: Information about the different relation types.
Parameters: query — Only show results where the relation type matches this query (substring match, optional).
Paging: optional
Filter: none
Sort: rtype, count
Result:
total:INTTotal number of results.
page:INTResult page number (first has page number 1).
rp:INTResults per page.
data:ARRAY OF HASHESArray with results.
    rtype:STRINGRelation type
    count:INTNumber of relations with this type.
    count_fraction:INTNumber of relations with this type divided by the overall number of relations.
    prevalent_roles:ARRAYPrevalent member roles.
        role:STRINGMember role
        count:INTNumber of members with this role.
        fraction:FLOATNumber of members with this role divided by all members.
Example: /api/4/relations/all?page=1&rp=10
UI Example: /relations
Notes: prevalent_roles can be null if taginfo doesn't have role information for this relation type, or an empty array when there are no roles with more than 1% of members

/api/4/search/by_key_and_value

Path: /api/4/search/by_key_and_value
Description: Search for tags by key and/or value.
Parameters: query — Value to search for (substring search, required).
Paging: optional
Filter: none
Sort: count_all, key, value
Result:
total:INTTotal number of results.
page:INTResult page number (first has page number 1).
rp:INTResults per page.
data:ARRAY OF HASHESArray with results.
    key:STRINGKey
    value:STRINGValue
    count_all:INTNumber of objects in the database with this tag.
Example: /api/4/search/by_key_and_value?query=highway%3Dresidential&page=1&rp=10
UI Example: /search?q=highway%3Dresidential

/api/4/search/by_keyword

Path: /api/4/search/by_keyword
Description: Search for keys and tags by keyword in wiki pages.
Parameters: query — Value to search for (substring search, required).
Paging: optional
Filter: none
Sort: count_all, key, value
Result:
total:INTTotal number of results.
page:INTResult page number (first has page number 1).
rp:INTResults per page.
data:ARRAY OF HASHESArray with results.
    key:STRINGKey
    value:STRINGValue
Example: /api/4/search/by_keyword?query=fire&page=1&rp=10
UI Example: /search?q=fire#fulltext

/api/4/search/by_role

Path: /api/4/search/by_role
Description: Search for relation roles.
Parameters: query — Role to search for (substring search, required).
Paging: optional
Filter: none
Sort: count_all, rtype, role
Result:
total:INTTotal number of results.
page:INTResult page number (first has page number 1).
rp:INTResults per page.
data:ARRAY OF HASHESArray with results.
    rtype:STRINGRelation type.
    role:STRINGRole
    count_all:INTNumber of objects in the database with this role.
Example: /api/4/search/by_role?query=foo&page=1&rp=10
UI Example: /search?q=foo#roles

/api/4/search/by_value

Path: /api/4/search/by_value
Description: Search for tags by value.
Parameters: query — Value to search for (substring search, required).
Paging: optional
Filter: none
Sort: count_all, key, value
Result:
total:INTTotal number of results.
page:INTResult page number (first has page number 1).
rp:INTResults per page.
data:ARRAY OF HASHESArray with results.
    key:STRINGKey
    value:STRINGValue
    count_all:INTNumber of objects in the database with this tag.
Example: /api/4/search/by_value?query=foo&page=1&rp=10
UI Example: /search?q=foo#values

/api/4/site/info

Path: /api/4/site/info
Description: Get information about this taginfo site.
Parameters: none
Paging: no
Filter: none
Sort: none
Result:
url:STRINGURL
name:STRINGName
description:STRINGDescription
icon:STRINGPath to icon which appears on the lop left corner of all pages.
contact:STRINGContact information to admin.
area:STRINGDescription of area covered.
Example: /api/4/site/info
UI Example:

/api/4/site/sources

Path: /api/4/site/sources
Description: Get information about the data sources used.
Parameters: none
Paging: no
Filter: none
Sort: none
Result:
name:STRINGName
data_until:STRINGAll changes in the source until this date are reflected in taginfo.
update_start:STRINGDate/Timestamp when last update was started.
update_end:STRINGDate/Timestamp when last update was finished.
Example: /api/4/site/sources
UI Example: /sources

/api/4/tag/combinations

Path: /api/4/tag/combinations
Description: Find keys and tags that are used together with a given tag.
Parameters: key — Tag key (required).
query — Only show results where the other_key or other_value matches this query (substring match, optional).
value — Tag value (required).
Paging: optional
Filter: all — No filter.
nodes — Only values on tags used on nodes.
relations — Only values on tags used on relations.
ways — Only values on tags used on ways.
Sort: together_count, other_tag, from_fraction
Result:
total:INTTotal number of results.
page:INTResult page number (first has page number 1).
rp:INTResults per page.
data:ARRAY OF HASHESArray with results.
    other_key:STRINGOther key.
    other_value:STRINGOther value (may be empty).
    together_count:INTNumber of objects that have both this tag and other key (or tag).
    to_fraction:FLOATFraction of objects with this tag that also have the other key (or tag).
    from_fraction:FLOATFraction of objects with other key (or tag) that also have this tag.
Example: /api/4/tag/combinations?key=highway&value=residential&page=1&rp=10&sortname=together_count&sortorder=desc
UI Example: /tags/highway=residential#combinations

/api/4/tag/josm/style/rules

Path: /api/4/tag/josm/style/rules
Description: List rules and symbols for the given tag in JOSM styles.
Parameters: key — Tag key (required).
style — JOSM style (required).
value — Tag value (required).
Paging: optional
Filter: none
Sort: none
Result:
total:INTTotal number of results.
page:INTResult page number (first has page number 1).
rp:INTResults per page.
data:ARRAY OF HASHESArray with results.
    key:STRINGKey
    value:STRINGValue
    value_bool:STRING"yes" or "no". Null if the value is not boolean.
    rule:STRINGJOSM style rule in XML format.
    area_color:STRINGFill color for area (if area rule).
    line_color:STRINGStroke color for line (if line rule).
    line_width:INTLine width (if line rule).
    icon:STRINGIcon path (if icon rule).
Example: /api/4/tag/josm/style/rules?style=standard&key=highway&value=residential&page=1&rp=10
UI Example: /tags/highway=residential#josm

/api/4/tag/stats

Path: /api/4/tag/stats
Description: Show some database statistics for given tag.
Parameters: key — Tag key (required).
value — Tag value (required).
Paging: no
Filter: none
Sort: none
Result:
total:INTTotal number of results.
data:ARRAY OF HASHESArray with results.
    type:STRINGObject type ("all", "nodes", "ways", or "relations")
    count:INTNumber of objects with this type and tag.
    count_fraction:FLOATNumber of objects in relation to all objects.
Example: /api/4/tag/stats?key=amenity&value=school
UI Example: /tags/amenity=school#overview

/api/4/tag/wiki_pages

Path: /api/4/tag/wiki_pages
Description: Get list of wiki pages in different languages describing a tag.
Parameters: key — Tag key (required)
value — Tag value (required).
Paging: no
Filter: none
Sort: none
Result:
total:INTTotal number of results.
data:ARRAY OF HASHESArray with results.
    lang:STRINGLanguage code.
    language:STRINGLanguage name in its language.
    language_en:STRINGLanguage name in English.
    title:STRINGWiki page title.
    description:STRINGShort description of tag from wiki page.
    image:HASHAssociated image.
        title:STRINGWiki page title of associated image.
        width:INTWidth of image.
        height:INTHeight of image.
        mime:STRINGMIME type of image.
        image_url:STRINGImage URL
        thumb_url_prefix:STRINGPrefix of thumbnail URL.
        thumb_url_suffix:STRINGSuffix of thumbnail URL.
    on_node:BOOLIs this a tag for nodes?
    on_way:BOOLIs this a tag for ways?
    on_area:BOOLIs this a tag for areas?
    on_relation:BOOLIs this a tag for relations?
    tags_implies:ARRAY OF STRINGSList of keys/tags implied by this tag.
    tags_combination:ARRAY OF STRINGSList of keys/tags that can be combined with this tag.
    tags_linked:ARRAY OF STRINGSList of keys/tags related to this tag.
Example: /api/4/tag/wiki_pages?key=highway&value=residential
UI Example: /tags/highway=residential#wiki
Notes: To get the complete thumbnail image URL, concatenate thumb_url_prefix, width of image in pixels, and thumb_url_suffix. The thumbnail image width must be smaller than width, use the image_url otherwise.

/api/4/tags/popular

Path: /api/4/tags/popular
Description: Get list of most often used tags.
Parameters: query — Only show tags matching this query (substring match in key and value, optional).
Paging: optional
Filter: none
Sort: tag, count_all, count_nodes, count_ways, count_relations
Result:
total:INTTotal number of results.
page:INTResult page number (first has page number 1).
rp:INTResults per page.
data:ARRAY OF HASHESArray with results.
    key:STRINGKey
    value:STRINGValue
    in_wiki:BOOLIn there a page in the wiki for this tag?
    count_all:INTNumber of objects in the OSM database with this tag.
    count_all_fraction:FLOATNumber of objects in relation to all objects.
    count_nodes:INTNumber of nodes in the OSM database with this tag.
    count_nodes_fraction:FLOATNumber of nodes in relation to all tagged nodes.
    count_ways:INTNumber of ways in the OSM database with this tag.
    count_ways_fraction:FLOATNumber of ways in relation to all ways.
    count_relations:INTNumber of relations in the OSM database with this tag.
    count_relations_fraction:FLOATNumber of relations in relation to all relations.
Example: /api/4/tags/popular?page=1&rp=10&sortname=tag&sortorder=asc
UI Example: /tags

/api/4/wiki/languages

Path: /api/4/wiki/languages
Description: List languages taginfo knows about and how many wiki pages describing keys and tags there are in these languages.
Parameters: none
Paging: no
Filter: none
Sort: code, native_name, english_name, wiki_key_pages, wiki_tag_pages
Result:
total:INTTotal number of results.
data:ARRAY OF HASHESArray with results.
    code:STRINGLanguage code.
    native_name:STRINGName of language in this language.
    english_name:STRINGName of language in English.
    wiki_key_pages:INTNumber of "Key" wiki pages in this language.
    wiki_key_pages_fraction:FLOATNumber of "Key" wiki pages in this language in relation to the number of keys described in any language in the wiki.
    wiki_tag_pages:INTNumber of "Tag" wiki pages in this language.
    wiki_tag_pages_fraction:FLOATNumber of "Tag" wiki pages in this language in relation to the number of tags described in any language in the wiki.
Example: /api/4/wiki/languages?sortname=wiki_key_pages&sortorder=desc
UI Example: /reports/languages
This website only works with Javascript! Please enable Javascript in your browser.