Skip to content

Elevation profile

$0.002 per callUSDC via x402POST /api/elevation-profile

Terrain elevation for up to 100 points anywhere on land (Copernicus DEM, 90 m), and for an ordered path its distance, total climb and descent...

Category: Live public dataTags: elevation terrain altitude dem profile hiking geo

Try in playground →

Details

Terrain elevation for up to 100 points anywhere on land (Copernicus DEM, 90 m), and for an ordered path its distance, total climb and descent, lowest and highest point and steepest leg in percent grade: for routing, drones, hiking, line of sight and flood siting. Cached for up to 24 hours. POST {"points":[[45.83,6.86],[45.92,7.0]]}. Weather data by Open-Meteo.com (CC BY 4.0). Elevation from the Copernicus DEM GLO-90 (European Union and ESA).

Parameters

NameTypeRequiredDescription
pointsarray of arrayyesUp to 100 [lat, lon] pairs (or {lat, lon} objects), in path order Up to 100 items.

Example request

curl -i -X POST https://agent402.tools/api/elevation-profile \
  -H "Content-Type: application/json" \
  -d '{"points":[[45.8326,6.8652],[45.9237,6.8694],[46.0207,7.7491]]}'

Watch a call get paid

RequestPOST /api/elevation-profile
402$0.002 USDC
SignPAYMENT-SIGNATURE
Settleon 14 chains
Answer200 OK
ReceiptAgent402-ReceiptEd25519

Example response

{
  "count": 3,
  "points": [
    {
      "lat": 45.8326,
      "lon": 6.8652,
      "elevationM": 4792
    },
    {
      "lat": 45.9237,
      "lon": 6.8694,
      "elevationM": 1041
    },
    {
      "lat": 46.0207,
      "lon": 7.7491,
      "elevationM": 1613
    }
  ],
  "path": {
    "distanceKm": 78.969,
    "gainM": 572,
    "lossM": 3751,
    "minM": 1041,
    "maxM": 4792,
    "steepestLeg": {
      "fromIndex": 0,
      "toIndex": 1,
      "gradePercent": -37,
      "lengthKm": 10.135
    }
  },
  "method": "Elevation of the 90 m terrain cell under each point. Distance is great-circle between consecutive points; climb and descent sum the rises and falls between them, so terrain between points is not counted.",
  "source": "api.open-meteo.com elevation (Copernicus DEM GLO-90, CC BY 4.0)",
  "credit": "Produced using Copernicus WorldDEM-30 (c) DLR e.V. 2010-2014 and (c) Airbus Defence and Space GmbH 2014-2018, provided under COPERNICUS by the European Union and ESA; all rights reserved. Neither the European Commission nor ECMWF is responsible for any use that may be made of the Copernicus information or data it contains.",
  "attributionText": "Weather data by Open-Meteo.com (CC BY 4.0).",
  "sourceUrl": "https://open-meteo.com/",
  "licenseUrl": "https://creativecommons.org/licenses/by/4.0/"
}
FieldTypeAlways presentIn the example
countnumberyes3
pointsarray of objectsyes3 items in the example
pathobjectyes6 fields: distanceKm, gainM, lossM, minM, maxM, steepestLeg
methodstringyesElevation of the 90 m terrain cell under each point. Distance is great-circle...
sourcestringyesapi.open-meteo.com elevation (Copernicus DEM GLO-90, CC BY 4.0)
creditstringyesProduced using Copernicus WorldDEM-30 (c) DLR e.V. 2010-2014 and (c) Airbus D...
attributionTextstringyesWeather data by Open-Meteo.com (CC BY 4.0).
sourceUrlstringyeshttps://open-meteo.com/
licenseUrlstringyeshttps://creativecommons.org/licenses/by/4.0/

From an MCP client

catalog.call {
  "slug": "elevation-profile",
  "params": {
    "points": [
      [
        45.8326,
        6.8652
      ],
      [
        45.9237,
        6.8694
      ],
      [
        46.0207,
        7.7491
      ]
    ]
  }
}

Hosted connector (https://agent402.tools/mcp): paid in the call. Stdio package (npx -y agent402-mcp@0.19.2): pays from a wallet or AGENT402_CREDITS_KEY.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.002" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.AGENT_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/elevation-profile", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "points": [
      [
        45.8326,
        6.8652
      ],
      [
        45.9237,
        6.8694
      ],
      [
        46.0207,
        7.7491
      ]
    ]
  }),
});

Get a wallet or run npx -y agent402-mcp@0.19.2 wallet new.

The quote (Python)

import base64, json, urllib.error, urllib.request

req = urllib.request.Request("https://agent402.tools/api/elevation-profile", method="POST", data="{\"points\":[[45.8326,6.8652],[45.9237,6.8694],[46.0207,7.7491]]}".encode(), headers={"Content-Type": "application/json"})
try:
    urllib.request.urlopen(req)
except urllib.error.HTTPError as e:
    quote = json.loads(base64.b64decode(e.headers["PAYMENT-REQUIRED"]))
    print(e.code, [(a["network"], a["amount"]) for a in quote["accepts"]])  # the price, per chain, in base units

Guides that use this tool

Related tools