{"uid":"cap_M5qzk5y26Q9jxp0qiOfCS","slug":"duo-data-utilities-plus-code-open-location-code-encode-decode-shorten-9c696f22","name":"Duo Data Utilities – Plus Code (Open Location Code) Encode/Decode/Shorten/Recover","description":"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.","url":"https://api.duoleads.com/v1/geo/pluscode?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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","valid"],"properties":{"bbox":{"type":"object","required":["min_lat","min_lon","max_lat","max_lon"],"properties":{"max_lat":{"type":"number"},"max_lon":{"type":"number"},"min_lat":{"type":"number"},"min_lon":{"type":"number"}}},"code":{"type":"string"},"valid":{"type":"boolean"},"center":{"type":"object","required":["lat","lon"],"properties":{"lat":{"type":"number"},"lon":{"type":"number"}}},"length":{"type":["integer","null"]},"reason":{"type":["string","null"]},"is_full":{"type":"boolean"},"is_short":{"type":"boolean"},"full_code":{"type":"string"},"precision_m":{"type":"number"}}},"meta":{"type":"object","required":["request_id","computed_at","price_usd","deterministic","disclaimer"],"properties":{"sources":{"type":"array","items":{"type":"object","required":["id","version","published"]}},"price_usd":{"type":"string"},"disclaimer":{"type":"string"},"request_id":{"type":"string"},"computed_at":{"type":"string","description":"RFC 3339 UTC with milliseconds"},"deterministic":{"type":"boolean"}}},"route":{"const":"/v1/geo/pluscode"},"version":{"type":"string"}}}}}}},"responseSchema":{"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"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.05","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.05/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_PNHskuHK-kUZPc7EWuQAR","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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.","exampleAgentPrompt":"Encode latitude 52.3728 and longitude 4.8936 as a 10-digit plus code, and tell me the precision in metres.","exampleUseCases":[{"title":"Generating shareable plus codes for field locations","prompt":"I have a remote field site at latitude -33.8688 and longitude 151.2093 — encode it as a 10-character plus code so I can share it with someone who doesn't have a street address."},{"title":"Recovering shortened code near a city","prompt":"Someone sent me the shortened plus code '4C+J4' and I know it's near Amsterdam (lat 52.3676, lon 4.9041) — can you recover the full plus code for me?"},{"title":"Decoding a plus code to precise coordinates","prompt":"I have the plus code '9F469VFV+4C' and need to know its exact centre coordinates and bounding box — can you decode it for me?"}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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).","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T00:46:12.503Z","isFirstParty":false,"canonicalSlug":"duo-data-utilities-plus-code-open-location-code-encode-decode-shorten-9c696f22"}