Free data

Kingdom Data API

Public kingdom facts as JSON, free, for people who build Discord bots and tools. Unofficial fan data: KingshotPro is not affiliated with Century Games.

What it is

Two read-only web addresses that return public facts about Kingshot kingdoms: the transfer group, the power caps, the KvK result of every season, and our own strength tier. Kingdom-level facts only. There are no player or alliance names, no login and no key.

The data is built from public KvK results and the public transfer history. It is not official data. It is the same data behind our kingdom facts page.

Machine-readable description (OpenAPI 3.0):

Open the OpenAPI file

The two endpoints

Both are GET. Both send Access-Control-Allow-Origin: *, so a browser page can call them.

1. The whole index

GET https://kingshotpro-api.kingshotpro.workers.dev/kingdoms/index

Every kingdom in one reply (about 2 MB unpacked, about 104 KB gzipped on the wire). Fetched with curl on 2026-11-20, formatted with jq, first 12 lines:

{
  "count": 2446,
  "generated": "2026-11-20",
  "kingdoms": [
    {
      "group": "1",
      "id": 1,
      "kvk": [
        {
          "bye": false,
          "castle": "W",
          "opponent": 2,

2. One kingdom

GET https://kingshotpro-api.kingshotpro.workers.dev/kingdoms/<id> where <id> is the kingdom number, for example 321.

The reply is one object, the same as that kingdom's entry in the index. Fetched with curl on 2026-11-20, formatted with jq, first 12 lines:

{
  "group": "2",
  "id": 321,
  "kvk": [
    {
      "bye": false,
      "castle": "W",
      "opponent": 282,
      "prep": "W",
      "season": 4
    },
    {

A number that is not a kingdom number gets HTTP 400 and {"error":"bad_id"}. A kingdom that is not in the index gets HTTP 404 and {"error":"not_found"}.

Field dictionary

Top level of the index

FieldTypeNull ruleMeaning
countnumberAlways setHow many kingdoms are in the list.
generatedstringAlways setThe date (YYYY-MM-DD) the index was built.
kingdomslistAlways setOne object per kingdom, shaped as the next table.

One kingdom

FieldTypeNull ruleMeaning
idnumberAlways setThe kingdom number.
groupstring or nullnull when the kingdom is not in a transfer groupThe transfer group, a string from "1" to "11". A string, not a number.
power_capnumber or nullnull when there is no groupThe normal power cap of the kingdom's transfer group, in plain units (780000000, not 780M). See the cap note below.
leading_capnumber or nullnull when there is no groupThe leading power cap of the group. The index does not say which kingdoms are leading, so do not use this to filter. See the cap note below.
openedstringAlways setA date (YYYY-MM-DD) on or before which the kingdom opened. It is a bound worked out from the first KvK season seen, not an exact opening day.
opened_is_boundbooleanAlways true todayTrue means opened is that bound.
kvklistMay be emptyOne object per season, oldest first, shaped as the KvK table below.
last_seasonnumberAlways setThe last KvK season in which the kingdom appears.
tierstring or nullnull under 12 gamesOur strength tier: S, A, B, C or D, S being the highest. See how the tier works.

One entry in kvk

FieldTypeNull ruleMeaning
seasonnumberAlways setThe KvK season number.
opponentnumber or nullnull for a byeThe opposing kingdom number.
prepstring or nullnull for a bye or a game not decided yet"W" if this kingdom won the preparation game, "L" if it lost.
castlestring or nullnull for a bye or a game not decided yet"W" or "L" for the castle game.
byebooleanAlways setTrue when the kingdom had a bye that season (no opponent).

The two cap fields

Power caps shown are those of the kingdom's transfer group in the latest window listed on the public transfer history (a tier). The King of a kingdom sets the cap their kingdom uses each window, so read the cap on your transfer screen.

How games are counted

A KvK game is one preparation result or one castle result. A bye is not a game. A result not decided yet is not a game. Wins and losses are counts of those results. Win rate is won divided by won plus lost. Show a rate only for a kingdom with at least 12 games, the same bar as the tier.

How the tier works

Strength tier. Our own rating, worked out from public KvK results. It shows who has been winning KvK games and nothing else.

The tier is a letter, S, A, B, C or D, with S the highest. A kingdom with fewer than 12 games has tier null, because that is too few games to label. The rating behind the letter is not published.

Caching and manners

  • Replies are cached for one hour (Cache-Control: public, max-age=3600). Cache them on your side too.
  • Please do not poll faster than once an hour. The data is rebuilt from new KvK results, so it does not change by the hour.
  • Send your own User-Agent header. A request with the default Python one was refused with HTTP 403 when we tried it.
  • Fetching one kingdom per message in a busy server is wasteful. Fetch the index once and read from your copy.

Attribution

Please link to kingshotpro.com when you show our tiers.

Stability

Fields may be added. Do not rely on field order. Read fields by name and ignore names you do not know.

Copy-paste examples

Each one was run against the live address on 2026-11-20.

curl and jq

# Kingdoms in transfer group 1 (a count)
curl -s --compressed https://kingshotpro-api.kingshotpro.workers.dev/kingdoms/index | jq '[.kingdoms[] | select(.group == "1")] | length'

# Kingdom 321: its last five KvK seasons, one line each
curl -s --compressed https://kingshotpro-api.kingshotpro.workers.dev/kingdoms/321 | jq -c '.kvk[-5:][]'

JavaScript (a bot): the top five kingdoms of group 1 by games won

Runs in Node 18 or newer and in a browser. It counts games won, not a rate, and breaks ties by kingdom number.

async function topFiveGroupOne() {
  const res = await fetch('https://kingshotpro-api.kingshotpro.workers.dev/kingdoms/index');
  if (!res.ok) throw new Error('HTTP ' + res.status);
  const data = await res.json();
  const wins = (k) => k.kvk.reduce((n, r) => n + (r.prep === 'W') + (r.castle === 'W'), 0);
  return data.kingdoms
    .filter((k) => k.group === '1')
    .map((k) => ({ id: k.id, wins: wins(k), tier: k.tier }))
    .sort((a, b) => b.wins - a.wins || a.id - b.id)
    .slice(0, 5);
}

topFiveGroupOne()
  .then((rows) => rows.forEach((r) => console.log('Kingdom ' + r.id + ': ' + r.wins + ' games won, tier ' + (r.tier || 'not rated'))))
  .catch((e) => console.log('Could not load the kingdom index: ' + e.message));

Python: one kingdom's last five seasons

import json
import urllib.request

URL = 'https://kingshotpro-api.kingshotpro.workers.dev/kingdoms/321'
# Send your own User-Agent: the default Python one is refused (HTTP 403).
req = urllib.request.Request(URL, headers={'User-Agent': 'my-kingdom-bot/1.0'})
try:
    with urllib.request.urlopen(req, timeout=20) as resp:
        k = json.load(resp)
except Exception as e:
    print('Could not load the kingdom:', e)
else:
    print('Kingdom', k['id'], 'tier', k['tier'] or 'not rated')
    for r in k['kvk'][-5:]:
        if r['bye']:
            print('Season', r['season'], 'bye')
        else:
            print('Season', r['season'], 'vs', r['opponent'], 'prep', r['prep'] or 'undecided', 'castle', r['castle'] or 'undecided')

Look kingdoms up without code

For one kingdom by hand, use the kingdom facts page.

Kingdom facts page