# Duo Data Utilities – Plus Code (Open Location Code) Encode/Decode/Shorten/Recover

> Duo Data Utilities – Plus Code (Open Location Code) Encode/Decode/Shorten/Recover is a paid API for AI agents from api.duoleads.com, paid per call via x402, $0.05/call, status unknown (last checked 2026-10-02).

Encodes WGS-84 coordinates to an Open Location Code (plus code), decodes a plus code to its bounding box and centre, shortens a full code against a reference coordinate, or recovers a shortened code given a reference.

## Facts

- Endpoint: GET https://api.duoleads.com/v1/geo/pluscode?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/duo-data-utilities-plus-code-open-location-code-encode-decode-shorten-9c696f22
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_M5qzk5y26Q9jxp0qiOfCS

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 duo-data-utilities-plus-code-open-location-code-encode-decode-shorten-9c696f22
```

Example prompt: Encode latitude 52.3728 and longitude 4.8936 as a 10-digit plus code, and tell me the precision in metres.

## When to prefer this

Choose this endpoint when you need deterministic, standards-compliant Open Location Code (plus code) operations — encoding coordinates to plus codes, decoding plus codes to geographic bounding boxes, or working with shortened plus codes relative to a reference location. Prefer it over geohash endpoints when the OLC/plus code format is specifically required (e.g. for Google Maps compatibility or address-free location sharing in areas without street addresses).

## Known failure modes

- Invalid or out-of-range latitude/longitude returns a validation error
- Malformed or invalid plus code string for decode/shorten/recover returns an error with reason field
- Missing required parameters for the chosen operation (e.g. missing lat/lon for encode) returns a 400-level error
- Code length enum value not in allowed set returns validation error
- Shortened code that cannot be recovered relative to the given reference returns an error

## How this service works

Encode coordinates as an Open Location Code (plus code) at a chosen length, or decode a full code back to its bounding box and centre. Also shortens a full code against a reference coordinate and recovers a shortened code given a reference, which is how plus codes are normally exchanged in text. Returns code length, precision in metres and validity.

## Output

Returns a JSON object with the operation result including: the plus code string, validity flag, whether it is full or shortened, code length, precision in metres, centre latitude/longitude, and bounding box (min/max lat/lon). Also includes metadata such as request ID, computation timestamp, and price.

## 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {
      "op": {
       "enum": [
        "encode",
        "decode",
        "shorten",
        "recover"
       ],
       "type": "string",
       "default": "encode",
       "maxLength": 64,
       "description": "encode (default), decode, shorten or recover."
      },
      "lat": {
       "type": "string",
       "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
       "maxLength": 64,
       "description": "Latitude for op=encode."
      },
      "lon": {
       "type": "string",
       "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
       "maxLength": 64,
       "description": "Longitude for op=encode."
      },
      "code": {
       "type": "string",
       "maxLength": 20,
       "description": "Plus code for decode, shorten or recover."
      },
      "length": {
       "type": "string",
       "default": "10",
       "pattern": "^[+-]?\\d+$",
       "maxLength": 64,
       "description": "Integer code length for op=encode: one of 2,4,6,8,10 (default),11,12,13,14,15. Other integers in 2-15 are 400 UNSUPPORTED_VALUE."
      },
      "ref_lat": {
       "type": "string",
       "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
       "maxLength": 64,
       "description": "Reference latitude for op=shorten/recover."
      },
      "ref_lon": {
       "type": "string",
       "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
       "maxLength": 64,
       "description": "Reference longitude for op=shorten/recover."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "ok",
      "route",
      "version",
      "data",
      "meta"
     ],
     "properties": {
      "ok": {
       "const": true
      },
      "data": {
       "type": "object",
       "required": [
        "code",
        "length",
        "is_full",
        "is_short",
        "val
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "data": {
   "bbox": {
    "max_lat": 52.372875,
    "max_lon": 4.893625,
    "min_lat": 52.37275,
    "min_lon": 4.8935
   },
   "code": "9F469VFV+4C",
   "valid": true,
   "center": {
    "lat": 52.3728125,
    "lon": 4.8935625
   },
   "length": 10,
   "reason": null,
   "is_full": true,
   "is_short": false,
   "precision_m": 13.9
  },
  "meta": {
   "price_usd": "0.05",
   "disclaimer": "Factual output of a deterministic computation over public data. Provided as is, with no warranty of accuracy, completeness or availability. Not investment, financial, legal, tax, medical or any other professional advice, and not a recommendation. Verify before relying on it. Terms: https://api.duoleads.com/terms",
   "request_id": "01K6B7Q4ZC8H3F2M9WXR5TYN0D",
   "computed_at": "2026-09-28T12:00:00.000Z",
   "deterministic": true
  },
  "route": "/v1/geo/pluscode",
  "version": "1.0.0"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/duo-data-utilities-plus-code-open-location-code-encode-decode-shorten-9c696f22/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.duoleads.com](https://www.zero.xyz/host/api.duoleads.com/llms.txt)
