Skip to content

application/geo+json MIME Type — Meaning, Usage & Examples

application/geo+json
Extensions: .geojson Class: application Spec: RFC 7946 (IANA registered)
View IANA registration ↗

application/geo+json means: application/geo+json is the registered media type for GeoJSON, a JSON-based format for encoding geographic data structures like points, lines, polygons and feature collections. RFC 7946 standardizes it for mapping and geospatial interchange, with coordinates in WGS84 longitude/latitude order. Application media types carry structured or binary data that a program consumes rather than a human reading raw bytes. The subtype tells the receiver exactly which parser, decoder or handler to invoke, so sending the correct Content-Type is part of the API contract: a mismatch makes servers reject the body with 415 Unsupported Media Type or clients mis-parse the payload. You will encounter application/geo+json in contexts such as web mapping libraries (leaflet, mapbox, openlayers); geospatial api responses and feature collections; storing and exchanging geographic boundaries and tracks. It is commonly associated with the file extension(s) .geojson. RFC 7946 fixes coordinate order to longitude,latitude (x,y) and the CRS to WGS84; older GeoJSON allowed other orders and projections. Validate coordinate order and avoid assuming projected coordinates, or maps will place features in the wrong location.

Advertisement
Ad slot · ref-top

When you'll see application/geo+json

  • Web mapping libraries (Leaflet, Mapbox, OpenLayers)
  • Geospatial API responses and feature collections
  • Storing and exchanging geographic boundaries and tracks

How to handle it

When handling an application type, set the Content-Type header explicitly on every request and response that carries a body, and advertise what you accept with the Accept header. Parse the payload with a library that matches the subtype rather than sniffing bytes, and validate the structure before trusting it. If a server returns 415, the declared type does not match what it expects — compare your header against the API documentation character for character, including parameters such as charset or boundary. As a final checklist for application types: register the exact subtype in your API documentation, validate incoming bodies against a schema before use, set X-Content-Type-Options: nosniff to stop MIME sniffing, and version your media types when the payload contract changes so old clients keep working.

Notes & gotchas

RFC 7946 fixes coordinate order to longitude,latitude (x,y) and the CRS to WGS84; older GeoJSON allowed other orders and projections. Validate coordinate order and avoid assuming projected coordinates, or maps will place features in the wrong location.

Examples

HTTP
HTTP/1.1 200 OK
Content-Type: application/geo+json
Content-Length: 83

Sample application/geo+json content delivered with the correct Content-Type header.
curl
curl -i -H "Accept: application/geo+json" https://api.example.com/v1/resource   # inspect the returned Content-Type
JavaScript (fetch)
const res = await fetch("/v1/resource", { headers: { Accept: "application/geo+json" } });
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();   // parsed structured payload
Python (requests)
import requests

res = requests.get("https://api.example.com/v1/resource",
                   headers={"Accept": "application/geo+json"}, timeout=10)
res.raise_for_status()
data = res.json()   # parsed structured payload

Frequently asked questions

What coordinate order does GeoJSON use?

RFC 7946 mandates longitude first, then latitude (x,y), in WGS84 degrees. This is opposite to the common lat,lon convention, so swap carefully when importing data.

Is application/geo+json just JSON?

It is JSON with a defined structure (Feature, FeatureCollection, geometry types) and the +json structured-syntax suffix. Parse it as JSON, then interpret the geographic semantics.

What happens if I send the wrong application Content-Type?

Servers that validate media types answer 415 Unsupported Media Type, and clients may parse the body with the wrong decoder. Always set Content-Type to the registered type that matches your payload, and set Accept to the types you can handle.

Is application/octet-stream a safe default?

It means 'arbitrary binary bytes' and forces a download rather than inline handling. Use it only when the real type is unknown or you deliberately want a save-as dialog; otherwise declare the specific registered type.

How do I debug a 415 Unsupported Media Type response?

Compare the Content-Type you actually sent against what the endpoint documents, including parameters like charset and boundary. A 415 means the server refuses that media type; send the exact registered type it accepts and retry.

Advertisement
Ad slot · ref-in-article

Try the JSON Formatter

Beautify, validate and minify JSON with clear error messages.

Open tool →