GPX Toolkit Stats Simplify Convert Formats API
Free tier included · LocationGPX Toolkit API parses GPX 1.0/1.1 files and computes track/segment/point counts, 2D/3D distance (WGS84 geodesic via geographiclib), elevation gain/loss, moving time, average speed, and geographic bounds. It also simplifies track points (RDP-based) and converts between GPX, GeoJSON, KML, and TopoJSON formats, plus generates circle polygons and polygon-to-line boundaries.
Ideal for fitness apps analyzing workout logs, route planners processing GPS exports, GIS pipelines converting coordinate formats, and no-install ETL jobs needing cross-language GPX processing.
The service is offline and stateless: no external network calls, no databases, and no request logs. Input is accepted as multipart file upload or JSON `{"xml": "..."}`. Files are capped at 10 MB (configurable via `GPXKIT_MAX_GPX`). Simplification uses an upper-bound `max_points` parameter (default 100, max 100,000). Elevation smoothing follows gpxpy defaults. Conversion endpoints accept standard GeoJSON FeatureCollections and KML/TopoJSON documents.
Honest limits: this API does not validate against live GPS services or registry data. Distance accuracy is within ~0.7% of gpxpy's spherical model due to WGS84 geodesic computation. Conversion fidelity depends on input geometry complexity.
Endpoints
| Method | Path | What it does |
|---|---|---|
GET | / | API metadata: name, version, and paths to the interactive docs and health endpoint. |
GET | /health | Liveness probe; returns status "ok" while the process is up. |
POST | /stats | Compute GPX statistics: point/track/segment counts, 2D/3D distance, elevation gain/loss, moving time, average speed, and bounds. Accepts multipart file or JSON {"xml": "..."}. |
POST | /simplify | Simplify GPX track points using RDP-based reduction. Accepts multipart file or JSON {"xml": "..."}. Query parameter max_points (default 100, max 100,000) sets the upper bound of points to keep. |
POST | /waypoints | Extract waypoints (wpt) from a GPX document. Accepts multipart file or JSON {"xml": "..."}. |
POST | /convert/gpx-to-geojson | Convert a GPX document into a GeoJSON FeatureCollection containing points, tracks, and routes. |
POST | /convert/geojson-to-gpx | Convert a GeoJSON FeatureCollection into a valid GPX 1.1 XML document. |
POST | /convert/kml-to-geojson | Parse a KML XML document and convert Placemarks (Points, LineStrings) into a GeoJSON FeatureCollection. |
POST | /convert/geojson-to-kml | Convert a GeoJSON FeatureCollection into a KML XML document string. |
POST | /convert/geojson-to-topojson | Convert a GeoJSON FeatureCollection into a TopoJSON topology object. Query parameter object_name (default "collection") sets the TopoJSON object property name. |
POST | /convert/topojson-to-geojson | Convert a TopoJSON topology object back into a GeoJSON FeatureCollection. Query parameter object_name (default "collection") specifies the TopoJSON object to extract. |
POST | /geom/point-to-circle | Generate a GeoJSON Polygon approximating a circle around a center coordinate. Query parameters: lat (required), lon (required), radius_m (default 1000), steps (default 32, 8–128). |
POST | /geom/polygon-to-line | Convert a GeoJSON Polygon (or MultiPolygon) into a LineString (or MultiLineString) boundary. |
Quick start
curl -X POST "https://gpx.p.rapidapi.com/stats" \
-H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
-H "X-RapidAPI-Host: gpx.p.rapidapi.com" \
-H "Content-Type: application/json" \
-d '{"xml":"<?xml version=\"1.0\"?><gpx version=\"1.1\" creator=\"demo\" xmlns=\"http://www.topografix.com/GPX/1/1\"><wpt lat=\"48.8584\" lon=\"2.2945\"><name>Eiffel Tower</name></wpt><trk><trkseg><trkpt lat=\"48.8584\" lon=\"2.2945\"><ele>35</ele></trkpt><trkpt lat=\"48.8606\" lon=\"2.3376\"><ele>38</ele></trkpt></trkseg></trk></gpx>"}'
FAQ
What file formats and sizes are supported?
GPX 1.0/1.1 files up to 10 MB. Input is accepted as multipart file upload or JSON `{"xml": "..."}`. GeoJSON, KML, and TopoJSON are supported for conversion endpoints.
Does the API make any external network calls?
No. All processing is offline — gpxpy and geographiclib run locally. There are no databases and no request logs.
How accurate are the distance calculations?
Distances use WGS84 geodesic computation (geographiclib), which is more accurate than gpxpy's default spherical model. Accuracy is within ~0.7% of the spherical approximation.
What does the simplify endpoint do?
It reduces track points using an RDP-based algorithm with an upper-bound `max_points` parameter (default 100, max 100,000). The actual output may contain fewer points than the limit depending on geometry complexity.
Try GPX Toolkit Stats Simplify Convert Formats free
Free tier on every plan. Get an API key and start calling in under a minute.
Open on RapidAPI