Getting All Plans for a Given Year - UN-OCHA/hpc-api GitHub Wiki

Caveats

The API endpoints presented here are currently the v2 endpoints, which are optimized for data-entry applications like RPM, rather than for consumption by external API users. As a result, they do not currently provide this data in an efficient manner.

This is something that we're in the process of addressing in the design and development of the next version of the HPC API, which you can read more about under the section Upcoming Changes to the API.

This document will be updated once it's possible to retrieve this data using the new API.

If you would like to be notified once this is possible, please see the section Keeping Up-To-Date below.

Request

The primary endpoint to use for getting all plans for a given year is this:

https://api.hpc.tools/v2/public/plan?year=<year>

This endpoint contains most of the high-level metadata regarding a plan, including:

  • It's ID (which can be used in later requests, such as Getting Caseload & Indicator Data).
  • the locations it covers
  • the emergencies associated with it
  • the type of plan it is (e.g. HRP, RRP, Flash Appeal, etc...)
  • the overall financial requirements

The response format looks something like:

{
  "data": [
    {
      "id": 1234, // this is the ID that you can use in later requests
      "planVersion": {
        "name": "Somalia Humanitarian Response Plan 2021"
      },
      "revisedRequirements": 1092121872, // The current financial requirements for the plan in USD
      // ...
    },
    // ...
  ]
}
⚠️ **GitHub.com Fallback** ⚠️