Introduction

Introduction

Welcome to the API Documentation for the (extremely unofficial) Horus Heresy API. This Public REST API is made by Rasmus Bremholm and started out as an experiment but is now growing into something larger.

The project started back in 2023, but is now currently being expanded in 2025 and has entered back into development once again.

To get started start out in the "Quick Start" part of this page and get fetching!

Quick Start

The fastest way to get started is by firing up your preferred testing app, either Postman or Insomnia. I prefer using Postman, but its really up to you.

After that you can try to reach the base endpoint:

https://horus-heresy-next.vercel.app/api/

Thats the base endpoint, and after the /api/ you enter whatever endpoint you require. The most practical one to get started is the /legions

It looks like this

https://horus-heresy-next.vercel.app/api/legions

This is where you find a big old list of all the legions and their data. Data like Primarchs, name, homeworld, army size etc...

Get All Legions

GET

/api/legions

This endpoint is like your "starting point". Here you will get it all, a big old list of all the different legions and all the data that goes along with each legion. Data like Primarch, Legion Name their homeworld, size of army and what allegence they had during the end of the Horus Heresy.

Parameters

traitorbooleanoptional
Want to find all the traitor legions? Just pass this in as a query. Of course getting all the loyalists is as easy as asking ?traitor=false
sortstringoptional
Sort lets you sort for the following values ["name", "id", "size"]. Use like this: "/api/legions?sort=name&order=desc"

Responses

200All legions
403Missing API Key

Get Legion By Id

GET

/api/legion/[id]

To get information about a specific legion you fetch the endpoint /legion/ with the ID of the legion you want at the end.

The id field needs to be populated with a number between 1 and 20. If you go outside this scope you will get an error telling you that the legion dosnt excist.

I might have to update this to be another http status code, 401 seems appropriate, but now im sure its 500 or something dumb.

Important: I made sure the ID field corresponds to each Legions "canonical" legionnumber instead of beeing just an index. This way the ID becomes a two-in-one get, both legion number and a convinient id to select specific legions.

For those (plebians) that dosnt know each legions number i have included a list below.

  1. Dark Angels
  2. [Redacted]
  3. Emperor's Children
  4. Iron Warriors
  5. White Scars
  6. Space Wolves
  7. Imperial Fists
  8. Night Lords
  9. Blood Angels
  10. Iron Hands
  11. [UNKNOWN]
  12. World Eaters
  13. Ultramarines
  14. Death Guard
  15. Thousand Sons
  16. Sons of Horus (Luna Wolves)
  17. Word Bearers
  18. Salamanders
  19. Raven Guard
  20. Alpha Legion

Fun Facts:

If you are wondering about entry 2 and 11, those legions where expunged from the Imperial records. So if you see entries such as [redacted], [deleted] or even [unknown] just know I added them for the "lore friendly" effect.

Responses

200OK
403Missing API Key
404Legion not found

Get All Primarchs

GET

/primarchs

Get all the Primarchs during the Horus Heresy. Get all the intresting facts about them.

Parameters

traitorbooleanoptional
A simple boolean to return all the traitor primarchs or false to return loyalists.
legion_idnumberoptional
Lets you filter on a specific legion
sortstringoptional
Lets you sort your primarchs on the following attributes ["name, "discovery_order", "legion_id"]

Responses

200

Code Examples

Basic Fetchjavascript
Fetch with error handelingjavascript
Query Paramsjavascript

Get All Characters

GET

/characters

Here you will get a list of notable characters. Im in the progress on expanding apon this list so just hold on if your favorite isn't on there yet.

Parameters

traitorbooleanoptional
Filters the response to show only traitors, or only loyalists if false.
legion_idstringoptional
Lets you filter your characters to a specific legion_id where legion_id is the legion number.

Responses

200