LGA risk
GET
https://api.ai4mproject.com/v1/risk/lgasScope: risk_scoresReturns the estimated risk score for every LGA in one state for one month.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
state |
string | Yes | Two-letter state code, such as KN |
period |
string | No | The month, as YYYY-MM. Defaults to the latest estimated month. Must not be a forecast month |
Parameters go in the query string.
Request
Section titled “Request”curl "https://api.ai4mproject.com/v1/risk/lgas?state=KN" \ -H "Authorization: Bearer $AI4M_API_KEY"kano = client.get_lga_risk("KN")for lga in kano.lgas: print(lga.lga_code, lga.lga, lga.score)const kano = await client.getLgaRisk("KN");for (const lga of kano.lgas) { console.log(lga.lga_code, lga.lga, lga.score);}kano, err := client.LGARisk(ctx, "KN", "")if err != nil { log.Fatal(err)}for _, lga := range kano.LGAs { fmt.Println(lga.LGACode, lga.LGA, lga.Score)}Response
Section titled “Response”| Field | Type | Description |
|---|---|---|
period |
string | The month the scores are for |
kind |
string | Always estimated for this endpoint |
state_code |
string | The state asked for |
state |
string | Its name |
lgas[].lga_code |
string | Stable LGA identifier. Join on this, not the name |
lgas[].lga |
string | LGA name |
lgas[].score |
number | Risk score from 0 to 1 |
lgas[].score_low |
number | Lower end of the likely range |
lgas[].score_high |
number | Upper end of the likely range |
lgas[].level |
string | very_low, low, moderate, high or very_high |
lgas[].is_urban |
boolean | Whether the LGA is classed as urban |
lgas[].population |
integer | People living in the LGA |
{ "period": "2026-07", "kind": "estimated", "state_code": "KN", "state": "Kano", "lgas": [ { "lga_code": "NGA.20.26_1", "lga": "Kunchi", "score": 0.549, "score_low": 0.308, "score_high": 0.79, "level": "very_high", "is_urban": false, "population": 170771 }, { "lga_code": "NGA.20.33_1", "lga": "Rimin Gado", "score": 0.541, "score_low": 0.3, "score_high": 0.782, "level": "very_high", "is_urban": false, "population": 162514 } ]}The example shows two of Kano’s 44 LGAs. LGAs are returned highest risk first.
Errors
Section titled “Errors”| Code | Status | When |
|---|---|---|
UNKNOWN_STATE |
404 | state is missing or is not a valid state code |
INVALID_PERIOD |
400 | period is not in the form YYYY-MM |
FORECAST_PERIOD |
400 | period is a forecast month. Use the matching forecast endpoint |
PERIOD_NOT_AVAILABLE |
404 | period is outside the months the data covers |
SCOPE_REQUIRED |
403 | The key does not include the scope this endpoint needs |
Any request can also return 401 for a bad key and 429 when a limit is reached. See Errors.