Basic Address Search Engine
Version
v1.0
Base URL
https://base-api.maiaddy.com/api
Protocol
REST / JSON
Auth
Bearer Token (API Key)
Coverage
Nigeria
Response
JSON
Overview
The Basic Address Search Engine (BASE) API is how you resolve addresses in Nigeria programmatically. Send it a loccode, a street name, or a GPS coordinate pair, and it responds with a structured, verified address that is clean, consistent, and ready for your application.
What this API does
- Looks up a full address from a loccode — the Maiaddy location identifier.
- Searches for streets that match a full or partial street name.
- Converts GPS coordinates (latitude/longitude) into a verified Nigerian address.
How it works: the 3-step flow
Every request to the BASE API follows the same pattern:
- You send input: a Loccode, a street name, or lat/lng coordinates.
- The API resolves it: an exact match for loccode, a text search for street name, and a nearest-neighbour lookup for coordinates.
- You get back structured data: street name, LGA, state, country, and road metadata all in consistent JSON.
Note
All results are drawn from validated records in the Maiaddy database, cross-referenced against OpenStreetMap road data. You are never working with unverified free-text addresses.
Authentication
All API requests require authentication using your API key. Include it in the Authorization header.
Authorization: Bearer YOUR_API_KEYSecurity Note
Never expose your API key in client-side code. Use backend proxies or our SDKs with token exchange for frontend implementations.
Quickstart
Make your first API call in under 5 minutes.
Location Code Search
curl https://base-api.maiaddy.com/api/v1/addresses/search/loccode/:loccode \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"loccode": "EN4A 1DQ",
"include_metadata": true
}'Expected Response
{
"loccode": "EN4A 1DQ",
"Udoji Street": "Udoji Street",
"addresses": [
"Udoji Street"
],
"lga": "Enugu North LGA",
"state": "Enugu State",
"streetInfo": {
"name": "Udoji Street",
"highwayType": "residential",
"length": 543.33,
"osmId": 174525750
},
"country": "NG"
}Coordinates Search
Look up address and loccode data for a latitude and longitude. Use query parameters latitude and longitude (replace the placeholders in the URL below).
https://base-api.maiaddy.com/api/v1/addresses/search/coordinates?latitude=:latitude&longitude=:longitude
Query Parameters
latituderequiredWGS-84 latitude in decimal degrees.
longituderequiredWGS-84 longitude in decimal degrees.
curl "https://base-api.maiaddy.com/api/v1/addresses/search/coordinates?latitude=9.0579&longitude=7.4951" \
-H "Authorization: Bearer YOUR_API_KEY"Example Response
{
"loccode": "EN4A 1DQ",
"streetName": "Udoji Street",
"addresses": [
"Udoji Street"
],
"lga": "Enugu North LGA",
"state": "Enugu State",
"streetInfo": {
"name": "Udoji Street",
"highwayType": "residential",
"length": 543.33,
"osmId": 174525750
},
"country": "NG"
}Response Fields
loccodestringMaiaddy loccode for the resolved location.
streetNamestringPrimary street name for the segment.
addressesarrayAddress strings associated with the result.
lgastringLocal government area.
statestringState or territory.
streetInfoobjectOSM-backed street metadata: name, highwayType, length (meters), osmId.
countrystringISO 3166-1 alpha-2 country code.
Street search
Look up loccode and address data by street name. Use the query parameter streetName (replace the placeholder in the URL below).
https://base-api.maiaddy.com/api/v1/addresses/search/street?streetName=:streetName
Query Parameters
streetNamerequiredStreet name to resolve (URL-encoded when passed in the query string).
curl "https://base-api.maiaddy.com/api/v1/addresses/search/street?streetName=Udoji Street" \
-H "Authorization: Bearer YOUR_API_KEY"Example Response
{
"loccode": "EN4A 1DQ",
"streetName": "Udoji Street",
"addresses": [
"Udoji Street"
],
"lga": "Enugu North LGA",
"state": "Enugu State",
"streetInfo": {
"name": "Udoji Street",
"highwayType": "residential",
"length": 543.33,
"osmId": 174525750
},
"country": "NG"
}SDK Implementation
Use our official SDKs for JavaScript, Python, Java, and Go to integrate the BASE API with minimal boilerplate. See Quickstart for examples.
UI Integration
Implement the loccode search field in your application interface.
Recommended Flow
Input Field
User types loccode into a dedicated field labeled "Enter Loccode" or "Location Code"
Validation
Real-time format validation as user types (pattern: XXXX XXX)
API Call
On valid input or user confirmation, call /api/v1/addresses/search/loccode/:loccode
Selection
Present returned addresses in a dropdown or modal for user selection
Auto-fill
Populate your address form fields with selected address data
import { useState } from 'react';
function AddressLookup() {
const [loccode,setLoccode] = useState('');
const [addresses,setAddresses] = useState([]);
const handleSearch = async () => {
setLoading(true);
const response = await fetch('https://base-api.maiaddy.com/api/v1/addresses/search/loccode/:loccode ', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ loccode, include_metadata: true }),
});
const data = await response.json();
setAddresses(data.addresses || []);
setLoading(false);
};
return (
<div>
<input placeholder="Enter loccode" value={loccode} onChange={(e) => setLoccode(e.target.value)} />
<button onClick={handleSearch} disabled={loading}> {loading ? 'Searching...' : 'Find Addresses'}</button>
</div>
);
}Common Use Cases
E-commerce Checkout
Customer enters loccode, selects their address from dropdown. Shipping address auto-populated with verified location data.
KYC & Identity Verification
User provides loccode during onboarding. Financial institution retrieves verified address linked to that location.
Logistics & Delivery
Driver enters recipient's loccode to retrieve all possible delivery points at that location—residential, business, or pickup point.
Service Provision
Utility companies, internet providers, and home services use loccodes to identify service locations and plan installations.
Ready to integrate?
Get your API keys and start building with the BASE API. Free tier includes 10,000 requests per month.
Get API Key