LGA forecasts
GET
https://api.ai4mproject.com/v1/forecasts/lgasScope: forecastsReturns forecast risk scores for every LGA in one state, one report for each month after the latest estimated month.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
state |
string | Yes | Two-letter state code, such as KN |
months |
integer | No | How many months ahead to return, from 1 to 4. Defaults to 4 |
Parameters go in the query string.
Request
Section titled “Request”curl "https://api.ai4mproject.com/v1/forecasts/lgas?state=KN&months=2" \ -H "Authorization: Bearer $AI4M_API_KEY"for report in client.get_lga_forecasts("KN", months=2): print(report.period, len(report.lgas))for (const report of await client.getLgaForecasts("KN", 2)) { console.log(report.period, report.lgas.length);}reports, err := client.LGAForecasts(ctx, "KN", 2)if err != nil { log.Fatal(err)}for _, report := range reports { fmt.Println(report.Period, len(report.LGAs))}Response
Section titled “Response”| Field | Type | Description |
|---|---|---|
forecasts |
array | One report per month, nearest month first |
forecasts[].period |
string | The month the scores are for |
forecasts[].kind |
string | Always forecast for this endpoint |
forecasts[].state_code |
string | The state asked for |
forecasts[].state |
string | Its name |
forecasts[].lgas |
array | The same fields as LGA risk |
{ "forecasts": [ { "period": "2026-08", "kind": "forecast", "state_code": "KN", "state": "Kano", "lgas": [ { "lga_code": "NGA.20.26_1", "lga": "Kunchi", "score": 0.543, "score_low": 0.273, "score_high": 0.787, "level": "very_high", "is_urban": false, "population": 170771 }, { "lga_code": "NGA.20.39_1", "lga": "Tofa", "score": 0.536, "score_low": 0.291, "score_high": 0.781, "level": "very_high", "is_urban": false, "population": 138370 } ] }, { "period": "2026-09", "kind": "forecast", "state_code": "KN", "state": "Kano", "lgas": [ { "lga_code": "NGA.20.26_1", "lga": "Kunchi", "score": 0.545, "score_low": 0.295, "score_high": 0.787, "level": "very_high", "is_urban": false, "population": 170771 }, { "lga_code": "NGA.20.39_1", "lga": "Tofa", "score": 0.543, "score_low": 0.297, "score_high": 0.784, "level": "very_high", "is_urban": false, "population": 138370 } ] } ]}The example was requested with months=2 and shows two LGAs in each month.
Errors
Section titled “Errors”| Code | Status | When |
|---|---|---|
UNKNOWN_STATE |
404 | state is missing or is not a valid state code |
INVALID_MONTHS |
400 | months is not a whole number from 1 to 4 |
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.