YardCodeAPI

YardCode API

Turn coordinates, addresses and UTM references into YardCodes, and back, from your own systems. Every answer also says whether the spot is a building, a road, water or open land.

Pay for what you use, with no monthly plan to renew. Keys, balance and usage live on the YardCode ADDVER platform. Onboarding takes a few minutes.

Everything is prepaid. Top up your account and each call draws from the balance. Nothing expires monthly, nothing auto-renews, and there is no plan to outgrow. Every paid response tells you what it cost and what is left.

How a YardCode reads

GQ9 U88 vowu

A YardCode has two parts. The first, GQ9 U88, is the yard: a small area of ground. The four letters after it, vowu, are the spot: one point inside that yard, precise to about 1.3 metres. Responses return them separately as yardcode and spot, and together as formatted.

Spaces are optional on input. GQ9U88vowu and GQ9 U88 vowu are the same code.

What it costs

CallUnitsPrice (at the standard rate a unit)
Validate a YardCodefreefree
Coordinates to YardCode1loading
YardCode to coordinates1loading
Street address to YardCode5loading
YardCode to street address5loading
Bulkas above, per itemas above, per item
Address Pickerper completed addressloading
Address verificationper verificationloading

Prices are read live from the platform, so this table always matches your bill. A rate agreed with your organisation overrides these.

Your keys

KeyLooks likeWhere it livesWhat it does
Secretsk_live_...Your server onlyEverything on this page
Publishablepk_live_...In your web pagesThe Address Picker, and nothing else
Appyca_live_...Inside a mobile appAddress verification from a phone

Send the secret key as a bearer token. A test key (sk_test_...) never charges your balance.

Authorization: Bearer sk_live_xxxxxxxxxxxxxxxx
Content-Type: application/json

All paths on this page are relative to https://addver.yardcode.ng.

Coordinates to YardCode

POST /addver/v1/convert/coordinates

{ "latitude": 7.3731, "longitude": 3.8678 }

Or in UTM, for survey and engineering work:

{ "easting": 595774.82, "northing": 815087.19,
  "zone_number": 31, "northern": true }

The main fields in the answer:

{
  "success": true,
  "yardcode": "GQ9 U88",
  "spot": "vowu",
  "formatted": "GQ9 U88 vowu",
  "latitude": 7.3731, "longitude": 3.8678,
  "what_is_here": { "category": "building", ... },
  "address_yardcode": "GQ9 U88 teza",
  "billing": { "units": 1, "units_left": 832 }
}
Show the full response
{
  "success": true,
  "yardcode": "GQ9 U88",
  "spot": "vowu",
  "formatted": "GQ9 U88 vowu",
  "latitude": 7.3731, "longitude": 3.8678,
  "state": "Oyo State",
  "lga": "Ibadan South West",
  "ward": "Alesinloye",
  "utm": { "easting": 595774.82, "northing": 815087.19,
           "zone_number": 31, "zone_letter": "N", "zone": "31N",
           "northern": true, "datum": "WGS84" },
  "place": "Ibadan South West Local Government (Ward: Alesinloye), Oyo State",
  "place_name": "Ibadan South West Local Government (Ward: Alesinloye), Oyo State",
  "location_url": "https://yardcode.ng/GQ9U88vowu",
  "what_is_here": { "checked": true, "category": "building", "label": "Building",
                    "detail": "Residential building", "confidence": "mapped" },
  "building": { "yardcode": "GQ9 U88 teza", "spans_yards": 2,
                "split": [ { "yard": "GQ9 U88", "pct": 59.5 },
                           { "yard": "GQ9 U89", "pct": 40.5 } ] },
  "street_address": {
    "text": "Plot 7, Block C, 12 Ososami Road, Ibadan South West LGA, Oyo State",
    "plot": "7", "block": "C", "unit": "",
    "house_number": "12", "side": "R",
    "street": "Ososami Road", "street_id": "OY-ISW-S0042",
    "street_status": "named", "provisional": false, "confidence": "high",
    "ward": "Alesinloye", "lga": "Ibadan South West", "state": "Oyo" },
  "address_yardcode": "GQ9 U88 teza",
  "billing": { "units": 1, "units_left": 832 }
}

Every response carries the UTM block, the ward, the local government and the state, whether you asked in degrees or in metres.

The street address

Where the national address register covers that state, a building also comes with its own street address in street_address.

street_statusMeans
namedThe street name comes from the map.
approvedNamed by the local government.
awaiting_nameA placeholder. The street has no official name yet.
name_proposedA name has been put forward and awaits approval.
no_roadNo mapped road reaches the building.

provisional: true means the street was matched from the map rather than confirmed, so show it as a suggestion, not a fact. House numbers are only ever recorded ones, never estimated.

plot, block and unit are filled where they are known and are empty strings otherwise. When present, they open the text line.

The whole street_address field is absent where the point is not on a building, or where the register does not yet cover that state. Neither is an error, and neither should fail your request.

What is at the spot

Every answer that contains a YardCode also says what is there. Exactly one category, always, in what_is_here.category.

CategoryMeansWhat to do with it
buildingThe point is inside a building outline.Store address_yardcode, the building's own code.
roadOn a road, or a bridge over water.Not a home or business address. Ask for a different point.
waterbodyRiver, lake, lagoon, reservoir or swamp.Not a home or business address. Ask for a different point.
open_landFarmland, school grounds, an empty plot.No mapped building. Much of Nigeria is unmapped, so treat this as a flag, not a verdict.
Store address_yardcode, not the pin. A building can straddle two yards. It belongs to the yard holding the larger share of its footprint, and its YardCode is the middle of that share, which is the centre of the roof. So two people tapping different corners of one roof file the same address. Where the point is not on a building, address_yardcode is simply the point's own code, so you can always store that one field.

what_is_here.confidence: "low" means little is mapped around the point, so the category is a best guess. checked: false means the map service could not be reached; the YardCode itself is still exact. Send "include_place": false to skip the check entirely.

Not to be confused with place. place is the administrative sentence ("Ibadan South West Local Government (Ward: Alesinloye), Oyo State"), as it has always been, so nothing already integrated breaks. The same sentence also comes back as place_name, if you prefer a name that can't be mistaken for what_is_here.

How long to keep answers

Two rules:
  • Building codes: no longer than a day. Building outlines are refreshed, and a building's code can move slightly when they are. Always use the address_yardcode you were returned; never compute one yourself or cache it for more than a day.
  • Street addresses: refresh at least monthly. More buildings get street addresses each month, and local governments name streets between the register's quarterly rebuilds. Re-fetch street_address.text when you display it.

YardCode to coordinates

POST /addver/v1/convert/yardcode

{ "yardcode": "GQ9 U88 vowu" }

Street address to YardCode

POST /addver/v1/convert/address

{ "address": "12 Adeola Odeku Street, Victoria Island, Lagos" }
{
  "success": true,
  "input_address": "12 Adeola Odeku Street, Victoria Island, Lagos",
  "formatted_address": "12 Adeola Odeku Street, Victoria Island, Lagos, Nigeria",
  "confidence_level": "high",
  "suggestions": [
    { "address": "12 Adeola Odeku St, Victoria Island, Lagos", "confidence": "medium",
      "latitude": 6.4290, "longitude": 3.4230 }
  ],
  "yardcode": "HY4 L76", "spot": "polo",
  "latitude": 6.4281, "longitude": 3.4219,
  "state": "Lagos State",
  "utm": { "easting": 547183.02, "northing": 710298.44, "zone_number": 31,
           "zone_letter": "N", "northern": true, "datum": "WGS84" },
  "billing": { "units": 5, "units_left": 827 }
}
confidence_levelMeans
highA rooftop match.
mediumAn interpolated or approximate match.
lowOnly a district could be matched. This is the centre of an area, not a building: confirm it with the person before you rely on it.

Suggestions before you commit

For an interactive form, fetch suggestions as the user types and resolve only the one they pick. Suggestions are free; you pay once, for the choice.

GET  /addver/v1/convert/address/suggest?q=adeola+odeku&session_token=abc123
POST /addver/v1/convert/address   { "place_id": "ChIJ...", "session_token": "abc123" }

YardCode to street address

POST /addver/v1/convert/address/reverse

{ "yardcode": "GQ9 U88 vowu" }

Much of Nigeria has no street address to return, which is the reason YardCode exists. Where none is found, the ward, local government and state still come back, with a note saying so rather than an empty field.

Bulkup to 100 per call

POST /addver/v1/convert/bulk/coordinates

{ "points": [ { "latitude": 7.3731, "longitude": 3.8678 },
              { "easting": 541924.30, "northing": 721189.22, "zone_number": 31 } ] }
POST /addver/v1/convert/bulk/yardcode

{ "yardcodes": ["GQ9 U88 vowu", "HY4 L76 polo"] }

One request instead of a hundred. Each result carries what_is_here, building and address_yardcode too.

A point that cannot be converted is reported in place with its reason, and the rest still come back. One bad coordinate in a delivery run should not throw away the other ninety-nine.

Validate a YardCodefree

GET /addver/api/resolve?yardcode=GQ9U88vowu

The Address Picker

For the people filling in your forms.

Most addresses typed into a Nigerian form cannot be found again by anybody. The Address Picker replaces the free-text box on your registration or onboarding page: your user types whatever they like, sees their own roof on a satellite map, drags a pin onto it, and your form receives a YardCode for that exact point.

One script tagNo framework, no build step, and the map is only fetched when somebody opens it.
They place the pinBy address, current location, a YardCode they know, or coordinates, then drag it onto the roof.
You get a YardCodeWith the coordinates, the ward, the LGA, the state and a signed token your server can check.
<input id="address" name="address" placeholder="Tap to find your address" readonly>
<input type="hidden" id="yardcode" name="yardcode">
<input type="hidden" id="lat" name="lat">
<input type="hidden" id="lng" name="lng">
<input type="hidden" id="yc_token" name="yc_token">

<script src="https://addver.yardcode.ng/widget/v1/yardcode-picker.js"></script>
<script>
  YardCodePicker.attach('#address', {
    key: 'pk_live_xxxxxxxxxxxx',
    fields: { yardcode:'#yardcode', lat:'#lat', lng:'#lng', token:'#yc_token' }
  });
</script>

You receive the pinned YardCode and, separately, the code the typed words alone resolved to, with its uncertainty. When the two differ, the pin is the answer, and the difference tells you how much the words were worth.

The address is collected in separate fields (house or plot number, street, block or floor, estate or community, town, landmark, state and local government) rather than as one free-text line. A line typed however somebody liked is what makes an address unusable later: the block and flat disappear into it and nothing can be matched on.

Those fields come back to you as unit, house_number, street, estate, town and landmark, because no pin on a map can show which flat somebody lives in, or that the house is behind the big church.

Check the token on your server

Anything a browser sends you is a claim; a hidden field can be edited in seconds. Redeem the token with your secret key and store what comes back.

reply = requests.post(
    "https://addver.yardcode.ng/widget/v1/verify",
    json={"token": request.form["yc_token"]},
    headers={"Authorization": f"Bearer {YARDCODE_SECRET_KEY}"},
    timeout=10)

trusted = reply.json() if reply.status_code == 200 else None
customer.yardcode = trusted["yardcode"]        # not request.form
The Address Picker is not a verification. It records where somebody says they live, placed on a map by them. To confirm that a person lives at an address, by their own phone reporting over 48 hours or a checked verifier at the door, use address verification: a separate service on the same account.

Address verification, in brief

Beyond conversion, the platform verifies that somebody lives where they say. A verification runs for 48 hours on the holder's phone and returns a verdict, a report and a certificate. Where no smartphone exists, a checked verifier visits the address instead. It is billed per verification, from the same balance.

POST /addver/v1/verifications                          start one
GET  /addver/v1/verifications/{id}                     follow it
POST /addver/v1/partner/verifications/{id}/report      the full report

Full documentation comes with your account.

Errors

CodeMeaning
400Something in the request is wrong; the message says what.
401The key is missing, wrong or rotated.
402Not enough balance for this call. Nothing was done and nothing was charged.
403The key is real but not allowed here, such as a publishable key on a secret endpoint.
404No such record, or it belongs to another organisation.
429Too many requests. Slow down and retry.
5xxOurs. Retry after a pause; nothing is lost.

Every error has the same shape:

{ "error": "A sentence for a person to read.", "code": "payment_required" }

Getting started

  1. Onboard as an organisation and get your keys.
  2. Build against the test key; it never charges your balance.
  3. Top up, switch to the live key, and watch your usage on the dashboard.

When something breaks

Integrations fail at inconvenient hours, and a documentation page is no use when your key is being rejected. Two ways to reach a person:

Help formaddver.yardcode.ng/addver/help. No account or key needed. Mark it urgent, or as something down in production, and it is flagged that way when it arrives.
Emailyardcode@rainigeria.com. The same inbox; the form simply arrives with the details filled in.

Include the endpoint, the exact error, the time, and any reference such as a ver_ or ycv_ id. It usually saves a round of questions.