# Touchstone Earth Magnetic Field API

> Touchstone Earth Magnetic Field API is a paid API for AI agents from touchstone.locomot.io, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-13).

Returns Earth's magnetic field components, declination, inclination, and total intensity for a given latitude/longitude using the World Magnetic Model (WMM)

## Facts

- Endpoint: GET https://touchstone.locomot.io/field
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/touchstone-earth-magnetic-field-api-0c689cd6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_b3TSvrt-oFP_629MAnN01

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability touchstone-earth-magnetic-field-api-0c689cd6
```

Example prompt: What's the magnetic declination and total field intensity at latitude 40.7128, longitude -74.0060 right now, at ground level?

## When to prefer this

Use this endpoint when you need precise, model-based Earth magnetic field data — including declination for compass correction, inclination, field intensity, and secular variation — at any geographic coordinate on or near Earth's surface. Prefer this over generic geolocation APIs when the application involves navigation correction, magnetometer calibration, geophysical surveys, or any use case requiring WMM-standard magnetic field values.

## Known failure modes

- Missing required lat or lon parameters returns a validation error
- Latitude out of range [-90,90] or longitude out of range [-180,180] returns schema validation error
- Altitude outside WMM valid range [-1, 850 km] may produce unreliable results
- Invalid ISO date or decimal year in 'when' parameter returns a parse error
- Payment not included or insufficient USDC results in HTTP 402 Payment Required

## How this service works

Deterministic WMM2025 magnetic field (one location/date). Free sample, no payment required: GET /play/field

## Output

A JSON object containing the magnetic field vector components (north X, east Y, down Z in nanoteslas), declination in degrees, inclination in degrees, horizontal intensity, total intensity in nT, secular variation rates, the model name and epoch, valid date range, and a compass note explaining the declination offset.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "lat",
      "lon"
     ],
     "properties": {
      "lat": {
       "type": "number",
       "maximum": 90,
       "minimum": -90
      },
      "lon": {
       "type": "number",
       "maximum": 180,
       "minimum": -180
      },
      "when": {
       "type": "string",
       "description": "ISO date / decimal year; default now"
      },
      "altitude_km": {
       "type": "number",
       "description": "optional, default 0; WMM valid [-1,850]"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "properties": {
    "model": {
     "type": "string"
    },
    "query": {
     "type": "object"
    },
    "units": {
     "type": "object"
    },
    "engine": {
     "type": "string"
    },
    "down_Z_nT": {
     "type": "number"
    },
    "east_Y_nT": {
     "type": "number"
    },
    "north_X_nT": {
     "type": "number"
    },
    "model_epoch": {
     "type": "number"
    },
    "valid_range": {
     "type": "array"
    },
    "compass_note": {
     "type": "string"
    },
    "deterministic": {
     "type": "boolean"
    },
    "declination_deg": {
     "type": "number"
    },
    "inclination_deg": {
     "type": "number"
    },
    "secular_variation": {
     "type": "object"
    },
    "total_intensity_nT": {
     "type": "number"
    },
    "horizontal_intensity_nT": {
     "type": "number"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/touchstone-earth-magnetic-field-api-0c689cd6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from touchstone.locomot.io](https://www.zero.xyz/host/touchstone.locomot.io/llms.txt)
