Skip to content

Instantly share code, notes, and snippets.

@psmolak
Last active February 13, 2024 16:22
Show Gist options
  • Save psmolak/409d038fb4a9157aecf25c84110d5b55 to your computer and use it in GitHub Desktop.
Save psmolak/409d038fb4a9157aecf25c84110d5b55 to your computer and use it in GitHub Desktop.
OGame API documentation

Statistics API

API url: s{server}-{country}.ogame.gameforge.com/api/{endpoint}

Endpoints

players.xml (1 day)
Contain list of all players on the server along with their names and status.

alliances.xml (1 day)
Contain list of all alliances on the server along with their members, name and tag.

serverData.xml (1 day)
Contain information about server properties such as name, language, speed, debris etc.

universe.xml (1 week)
Contain list of all planets on the server along with their names, coordinates and owners.

highscore.xml (1 hour)
Contain statistics of various types about players and alliances on the server.

	:category
	  1 - Player
	  2 - Alliance

	:type
	  0 - Total
	  1 - Economy
	  2 - Research
	  3 - Military
	  4 - Military Lost
	  5 - Military Built
	  6 - Military Destoyed
	  7 - Honor

playerData.xml (1 week)
Contain detailed information about particular player id such as position and planets.

	:id
	  <id> - Player ID

localization.xml
Provides translations of technology and mission names for particular community.

universes.xml
Provides list of available universes for paraticular community.

Raport API

API url: s{server}-{country}.ogame.gameforge.com/api/v1/{endpoint}

Endpoints

combat/report

    :api_key - Developer API key
    :cr_id - player's combat raport id

spy/report

    :api_key - Developer API key
    :sr_id - player's spy raport id

recycle/report

    :api_key - Developer API key
    :rr_id - player's recycling raport id

missile/report

    :api_key - Developer API key
    :mr_id - player's missile raport id

Result codes

Result code Description
1000 Ok
4000 Invalid version
4001 Invalid API key
4002 Invalid API Key expired
4003 Invalid API permission
4004 Invalid path
5000 Internal error
6000 Invalid CR ID
6001 Invalid SR ID
6002 Invalid RR ID
6003 Invalid MR ID
#! /usr/bin/python3
from bs4 import BeautifulSoup
import requests
BASE = 'https://pl.ogame.gameforge.com'
OGAME = 'ogame.gameforge.com'
def list_comm(url):
"""
List url for all community
"""
r = requests.get(url, verify=False)
soup = BeautifulSoup(r.text, 'html.parser')
tags = soup.find(id="mmoList1").find_all('a')
for tag in tags:
yield tag.get('href')[2:].split('/')[0]
def list_serv(url):
"""
Return all server indicators for a given community url
"""
r = requests.request('GET', 'http://' + url, verify=False, allow_redirects=True)
soup = BeautifulSoup(r.text, 'html.parser')
tags = soup.find(id="serverLogin").find_all('option')
for tag in tags:
yield tag.get('value').split('.')[0]
if __name__ == "__main__":
for comm in list_comm(BASE):
for serv in list_serv(comm):
print(serv + '.' + OGAME)
[ ar ]
https://s101-ar.ogame.gameforge.com
https://s111-ar.ogame.gameforge.com
https://s114-ar.ogame.gameforge.com
https://s115-ar.ogame.gameforge.com
https://s116-ar.ogame.gameforge.com
https://s117-ar.ogame.gameforge.com
https://s118-ar.ogame.gameforge.com
https://s119-ar.ogame.gameforge.com
https://s120-ar.ogame.gameforge.com
[ br ]
https://s127-br.ogame.gameforge.com
https://s128-br.ogame.gameforge.com
https://s101-br.ogame.gameforge.com
https://s103-br.ogame.gameforge.com
https://s106-br.ogame.gameforge.com
https://s115-br.ogame.gameforge.com
https://s121-br.ogame.gameforge.com
https://s123-br.ogame.gameforge.com
https://s124-br.ogame.gameforge.com
https://s125-br.ogame.gameforge.com
https://s126-br.ogame.gameforge.com
[ cz ]
https://s127-cz.ogame.gameforge.com
https://s101-cz.ogame.gameforge.com
https://s102-cz.ogame.gameforge.com
https://s110-cz.ogame.gameforge.com
https://s111-cz.ogame.gameforge.com
https://s119-cz.ogame.gameforge.com
https://s123-cz.ogame.gameforge.com
https://s124-cz.ogame.gameforge.com
https://s125-cz.ogame.gameforge.com
https://s126-cz.ogame.gameforge.com
[ de ]
https://s127-de.ogame.gameforge.com
https://s129-de.ogame.gameforge.com
https://s130-de.ogame.gameforge.com
https://s131-de.ogame.gameforge.com
https://s132-de.ogame.gameforge.com
https://s133-de.ogame.gameforge.com
https://s134-de.ogame.gameforge.com
https://s135-de.ogame.gameforge.com
https://s136-de.ogame.gameforge.com
https://s137-de.ogame.gameforge.com
https://s138-de.ogame.gameforge.com
https://s139-de.ogame.gameforge.com
https://s140-de.ogame.gameforge.com
https://s141-de.ogame.gameforge.com
https://s142-de.ogame.gameforge.com
https://s143-de.ogame.gameforge.com
https://s144-de.ogame.gameforge.com
https://s145-de.ogame.gameforge.com
https://s146-de.ogame.gameforge.com
https://s147-de.ogame.gameforge.com
https://s148-de.ogame.gameforge.com
https://s105-de.ogame.gameforge.com
https://s115-de.ogame.gameforge.com
https://s121-de.ogame.gameforge.com
https://s122-de.ogame.gameforge.com
https://s124-de.ogame.gameforge.com
https://s125-de.ogame.gameforge.com
https://s1-de.ogame.gameforge.com
https://s79-de.ogame.gameforge.com
https://s82-de.ogame.gameforge.com
[ dk ]
https://s104-dk.ogame.gameforge.com
https://s113-dk.ogame.gameforge.com
https://s114-dk.ogame.gameforge.com
https://s115-dk.ogame.gameforge.com
https://s116-dk.ogame.gameforge.com
https://s117-dk.ogame.gameforge.com
https://s1-dk.ogame.gameforge.com
[ en ]
https://s128-en.ogame.gameforge.com
https://s129-en.ogame.gameforge.com
https://s130-en.ogame.gameforge.com
https://s131-en.ogame.gameforge.com
https://s132-en.ogame.gameforge.com
https://s133-en.ogame.gameforge.com
https://s134-en.ogame.gameforge.com
https://s135-en.ogame.gameforge.com
https://s136-en.ogame.gameforge.com
https://s137-en.ogame.gameforge.com
https://s138-en.ogame.gameforge.com
https://s140-en.ogame.gameforge.com
https://s141-en.ogame.gameforge.com
https://s142-en.ogame.gameforge.com
https://s143-en.ogame.gameforge.com
https://s144-en.ogame.gameforge.com
https://s145-en.ogame.gameforge.com
https://s146-en.ogame.gameforge.com
https://s139-en.ogame.gameforge.com
https://s147-en.ogame.gameforge.com
https://s117-en.ogame.gameforge.com
https://s118-en.ogame.gameforge.com
https://s120-en.ogame.gameforge.com
https://s122-en.ogame.gameforge.com
https://s123-en.ogame.gameforge.com
https://s1-en.ogame.gameforge.com
[ es ]
https://s127-es.ogame.gameforge.com
https://s128-es.ogame.gameforge.com
https://s130-es.ogame.gameforge.com
https://s134-es.ogame.gameforge.com
https://s136-es.ogame.gameforge.com
https://s137-es.ogame.gameforge.com
https://s138-es.ogame.gameforge.com
https://s139-es.ogame.gameforge.com
https://s140-es.ogame.gameforge.com
https://s141-es.ogame.gameforge.com
https://s142-es.ogame.gameforge.com
https://s143-es.ogame.gameforge.com
https://s144-es.ogame.gameforge.com
https://s145-es.ogame.gameforge.com
https://s146-es.ogame.gameforge.com
https://s147-es.ogame.gameforge.com
https://s148-es.ogame.gameforge.com
https://s101-es.ogame.gameforge.com
https://s106-es.ogame.gameforge.com
https://s116-es.ogame.gameforge.com
https://s117-es.ogame.gameforge.com
https://s119-es.ogame.gameforge.com
https://s124-es.ogame.gameforge.com
https://s126-es.ogame.gameforge.com
https://s1-es.ogame.gameforge.com
https://s50-es.ogame.gameforge.com
[ fi ]
https://s102-fi.ogame.gameforge.com
https://s103-fi.ogame.gameforge.com
[ fr ]
https://s127-fr.ogame.gameforge.com
https://s128-fr.ogame.gameforge.com
https://s131-fr.ogame.gameforge.com
https://s132-fr.ogame.gameforge.com
https://s133-fr.ogame.gameforge.com
https://s134-fr.ogame.gameforge.com
https://s135-fr.ogame.gameforge.com
https://s136-fr.ogame.gameforge.com
https://s137-fr.ogame.gameforge.com
https://s138-fr.ogame.gameforge.com
https://s139-fr.ogame.gameforge.com
https://s140-fr.ogame.gameforge.com
https://s141-fr.ogame.gameforge.com
https://s142-fr.ogame.gameforge.com
https://s143-fr.ogame.gameforge.com
https://s144-fr.ogame.gameforge.com
https://s145-fr.ogame.gameforge.com
https://s146-fr.ogame.gameforge.com
https://s147-fr.ogame.gameforge.com
https://s148-fr.ogame.gameforge.com
https://s149-fr.ogame.gameforge.com
https://s106-fr.ogame.gameforge.com
https://s119-fr.ogame.gameforge.com
https://s120-fr.ogame.gameforge.com
https://s122-fr.ogame.gameforge.com
https://s123-fr.ogame.gameforge.com
https://s126-fr.ogame.gameforge.com
https://s1-fr.ogame.gameforge.com
https://s10-fr.ogame.gameforge.com
https://s67-fr.ogame.gameforge.com
[ gr ]
https://s112-gr.ogame.gameforge.com
https://s115-gr.ogame.gameforge.com
https://s116-gr.ogame.gameforge.com
https://s117-gr.ogame.gameforge.com
https://s118-gr.ogame.gameforge.com
https://s1-gr.ogame.gameforge.com
[ hr ]
https://s109-hr.ogame.gameforge.com
https://s110-hr.ogame.gameforge.com
[ hu ]
https://s101-hu.ogame.gameforge.com
https://s102-hu.ogame.gameforge.com
https://s108-hu.ogame.gameforge.com
https://s115-hu.ogame.gameforge.com
https://s116-hu.ogame.gameforge.com
https://s117-hu.ogame.gameforge.com
https://s118-hu.ogame.gameforge.com
https://s119-hu.ogame.gameforge.com
https://s120-hu.ogame.gameforge.com
https://s121-hu.ogame.gameforge.com
[ it ]
https://s128-it.ogame.gameforge.com
https://s129-it.ogame.gameforge.com
https://s130-it.ogame.gameforge.com
https://s131-it.ogame.gameforge.com
https://s132-it.ogame.gameforge.com
https://s133-it.ogame.gameforge.com
https://s134-it.ogame.gameforge.com
https://s135-it.ogame.gameforge.com
https://s136-it.ogame.gameforge.com
https://s137-it.ogame.gameforge.com
https://s138-it.ogame.gameforge.com
https://s139-it.ogame.gameforge.com
https://s140-it.ogame.gameforge.com
https://s141-it.ogame.gameforge.com
https://s142-it.ogame.gameforge.com
https://s143-it.ogame.gameforge.com
https://s144-it.ogame.gameforge.com
https://s145-it.ogame.gameforge.com
https://s146-it.ogame.gameforge.com
https://s147-it.ogame.gameforge.com
https://s101-it.ogame.gameforge.com
https://s114-it.ogame.gameforge.com
https://s115-it.ogame.gameforge.com
https://s1-it.ogame.gameforge.com
https://s40-it.ogame.gameforge.com
[ jp ]
https://s101-jp.ogame.gameforge.com
https://s108-jp.ogame.gameforge.com
[ mx ]
https://s101-mx.ogame.gameforge.com
https://s110-mx.ogame.gameforge.com
https://s112-mx.ogame.gameforge.com
https://s113-mx.ogame.gameforge.com
https://s114-mx.ogame.gameforge.com
https://s115-mx.ogame.gameforge.com
[ nl ]
https://s104-nl.ogame.gameforge.com
https://s107-nl.ogame.gameforge.com
https://s116-nl.ogame.gameforge.com
https://s117-nl.ogame.gameforge.com
https://s118-nl.ogame.gameforge.com
https://s119-nl.ogame.gameforge.com
https://s120-nl.ogame.gameforge.com
https://s121-nl.ogame.gameforge.com
https://s122-nl.ogame.gameforge.com
https://s123-nl.ogame.gameforge.com
https://s124-nl.ogame.gameforge.com
https://s3-nl.ogame.gameforge.com
[ no ]
https://s101-no.ogame.gameforge.com
[ pl ]
https://s127-pl.ogame.gameforge.com
https://s128-pl.ogame.gameforge.com
https://s129-pl.ogame.gameforge.com
https://s130-pl.ogame.gameforge.com
https://s131-pl.ogame.gameforge.com
https://s132-pl.ogame.gameforge.com
https://s133-pl.ogame.gameforge.com
https://s134-pl.ogame.gameforge.com
https://s135-pl.ogame.gameforge.com
https://s136-pl.ogame.gameforge.com
https://s137-pl.ogame.gameforge.com
https://s138-pl.ogame.gameforge.com
https://s139-pl.ogame.gameforge.com
https://s140-pl.ogame.gameforge.com
https://s141-pl.ogame.gameforge.com
https://s142-pl.ogame.gameforge.com
https://s143-pl.ogame.gameforge.com
https://s144-pl.ogame.gameforge.com
https://s145-pl.ogame.gameforge.com
https://s146-pl.ogame.gameforge.com
https://s147-pl.ogame.gameforge.com
https://s148-pl.ogame.gameforge.com
https://s104-pl.ogame.gameforge.com
https://s114-pl.ogame.gameforge.com
https://s117-pl.ogame.gameforge.com
https://s120-pl.ogame.gameforge.com
https://s123-pl.ogame.gameforge.com
https://s125-pl.ogame.gameforge.com
https://s126-pl.ogame.gameforge.com
https://s68-pl.ogame.gameforge.com
[ pt ]
https://s127-pt.ogame.gameforge.com
https://s128-pt.ogame.gameforge.com
https://s129-pt.ogame.gameforge.com
https://s103-pt.ogame.gameforge.com
https://s117-pt.ogame.gameforge.com
https://s121-pt.ogame.gameforge.com
https://s122-pt.ogame.gameforge.com
https://s123-pt.ogame.gameforge.com
https://s124-pt.ogame.gameforge.com
https://s125-pt.ogame.gameforge.com
https://s126-pt.ogame.gameforge.com
https://s25-pt.ogame.gameforge.com
[ ro ]
https://s110-ro.ogame.gameforge.com
https://s113-ro.ogame.gameforge.com
https://s115-ro.ogame.gameforge.com
https://s116-ro.ogame.gameforge.com
https://s117-ro.ogame.gameforge.com
https://s118-ro.ogame.gameforge.com
https://s119-ro.ogame.gameforge.com
https://s1-ro.ogame.gameforge.com
[ ru ]
https://s127-ru.ogame.gameforge.com
https://s128-ru.ogame.gameforge.com
https://s129-ru.ogame.gameforge.com
https://s130-ru.ogame.gameforge.com
https://s131-ru.ogame.gameforge.com
https://s132-ru.ogame.gameforge.com
https://s133-ru.ogame.gameforge.com
https://s134-ru.ogame.gameforge.com
https://s135-ru.ogame.gameforge.com
https://s136-ru.ogame.gameforge.com
https://s137-ru.ogame.gameforge.com
https://s138-ru.ogame.gameforge.com
https://s139-ru.ogame.gameforge.com
https://s140-ru.ogame.gameforge.com
https://s141-ru.ogame.gameforge.com
https://s142-ru.ogame.gameforge.com
https://s101-ru.ogame.gameforge.com
https://s103-ru.ogame.gameforge.com
https://s119-ru.ogame.gameforge.com
https://s125-ru.ogame.gameforge.com
https://s1-ru.ogame.gameforge.com
[ se ]
https://s103-se.ogame.gameforge.com
https://s105-se.ogame.gameforge.com
https://s107-se.ogame.gameforge.com
[ si ]
https://s101-si.ogame.gameforge.com
https://s105-si.ogame.gameforge.com
[ sk ]
https://s101-sk.ogame.gameforge.com
https://s108-sk.ogame.gameforge.com
https://s109-sk.ogame.gameforge.com
[ tr ]
https://s128-tr.ogame.gameforge.com
https://s131-tr.ogame.gameforge.com
https://s132-tr.ogame.gameforge.com
https://s133-tr.ogame.gameforge.com
https://s134-tr.ogame.gameforge.com
https://s135-tr.ogame.gameforge.com
https://s136-tr.ogame.gameforge.com
https://s137-tr.ogame.gameforge.com
https://s138-tr.ogame.gameforge.com
https://s139-tr.ogame.gameforge.com
https://s140-tr.ogame.gameforge.com
https://s141-tr.ogame.gameforge.com
https://s142-tr.ogame.gameforge.com
https://s143-tr.ogame.gameforge.com
https://s144-tr.ogame.gameforge.com
https://s145-tr.ogame.gameforge.com
https://s146-tr.ogame.gameforge.com
https://s101-tr.ogame.gameforge.com
https://s108-tr.ogame.gameforge.com
https://s116-tr.ogame.gameforge.com
https://s120-tr.ogame.gameforge.com
https://s121-tr.ogame.gameforge.com
https://s1-tr.ogame.gameforge.com
https://s50-tr.ogame.gameforge.com
[ tw ]
https://s101-tw.ogame.gameforge.com
https://s115-tw.ogame.gameforge.com
https://s116-tw.ogame.gameforge.com
https://s117-tw.ogame.gameforge.com
https://s118-tw.ogame.gameforge.com
https://s119-tw.ogame.gameforge.com
[ us ]
https://s128-us.ogame.gameforge.com
https://s129-us.ogame.gameforge.com
https://s130-us.ogame.gameforge.com
https://s131-us.ogame.gameforge.com
https://s132-us.ogame.gameforge.com
https://s133-us.ogame.gameforge.com
https://s134-us.ogame.gameforge.com
https://s135-us.ogame.gameforge.com
https://s136-us.ogame.gameforge.com
https://s137-us.ogame.gameforge.com
https://s138-us.ogame.gameforge.com
https://s116-us.ogame.gameforge.com
https://s1-us.ogame.gameforge.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment