MaPit is a database and web service that maps points to administrative area information and polygons for Norway (see the UK version). The source code is available on GitHub.
NUUG is a member organisation for people interested in free
software, open standards and UNIX-like operating systems. Please
become a member if you want
to keep NUUG going.
mySociety is run by a registered charity – please
donate to help keep mySociety going and
to be able to continue to do things like this!
This site is filled with only open data, so you can be secure that you can reuse the data from this site under the minimal terms of the licences given below. It is based on Kommune and Fylkes area info from OpenStreetMap and Norwegian post code coordinates from Erik Bolstad.
This database contains OpenStreetMap data © OpenStreetMap and contributors, CC-BY-SA-2.0. The post code coordinate data is © Erik Bolstad (CC-BY-3.0)
API
Non-commercial, low-volume use of this service is free. You will need to attribute data sources as per their licenses, and please do attribute us too :) For commercial or high-volume usage, please contact us about using the service, by licensing or by helping you install your own version.
All calls below are made to http://mapit.nuug.no/ and return JSON (on some calls, stick .html on the end for an HTML version). By default, calls will return active areas; for some calls you may specify a previous generation to look up instead. Whenever an area is returned from MaPit, it is as a dictionary with the following keys: id, name, country, type, parent_area, generation_low, generation_high, codes.
By postcode
- /postcode/[postcode] – information on a particular postcode, including its location in WGS84 latitude/longitude, and the areas it is contained within. You may specify a previous generation as a ?generation=N parameter. Example postcode lookup.
- /postcode/partial/[partial postcode] – location information on the centroid of a partial postcode. Example partial postcode lookup.
Multiple areas
- /areas/[area IDs, separated by commas] — information on more than one area at once, as a dictionary indexed by area ID. Example area IDs lookup.
- /areas/[area IDs, separated by commas]/geometry – all the geometry information you would get from single geometry calls.
- /areas/[type OR types] – all the areas in a specific area type or types (separated by commas). You may specific a minimum generation with the min_generation parameter. The current list of types is: NKO (kommune), NFY (fylke), NRA (vegvesen), NPT (kollektivtransportselskap), NPG (kraftregionselskap), NRR (jernbaneverk), NSA (kystverk).
- /areas/[name] – all areas that start with the specified text. You may restrict results to a type or types with the type parameter (as always, multiple separated by commas), or expand to previous generations with the min_generation parameter. Example lookup of all areas starting “As”.
Generations
- /generations – return a list of all generations.
By point
An SRID is a unique number referring to a particular co-ordinate system; the one you probably are interested in is 4326 for WGS84 lon/lat. You can restrict results to particular area types with a type parameter (multiple types separated by commas), and have results for a previous generation with a generation parameter. Note that x,y means longitude,latitude.
- /point/[SRID]/[x],[y] – the areas covering the particular point. Example of areas containing (59,10).
- /point/[SRID]/[x],[y]/box – the areas whose bounding boxes cover the particular point.
By area ID
- /area/[area ID] – information on a particular area. Example of an area’s results.
- /area/[area ID]/geometry – geometry information on the area including its centroid, extent and area.
- /area/[area ID].[kml|geojson|wkt] – the actual geometry of the area, in the specified format (WGS84 for KML, OSGB otherwise). Example KML file on a Google Map. You can specify a simplify_tolerance parameter to return a simplified polygon.
- /area/[SRID]/[area ID].[kml|json|wkt] – the actual geometry of the area, in the specified format and geometry.
All the following can take a type parameter to restrict results to a type or types:
- /area/[area ID]/children – all the children of a particular area. Example of all kommune within Akershus.
- /area/[area ID]/touches – all the areas that border the selected area. Example of all areas touching Oslo.

