Skip to content

ogamed full documentation

Alain Gilbert edited this page Sep 13, 2018 · 18 revisions

POST /bot/set-user-agent
GET /bot/server-url
POST /bot/page-content
GET /bot/login
GET /bot/logout
GET /bot/server/speed
GET /bot/server/version
GET /bot/server/time
GET /bot/is-under-attack
GET /bot/user-infos
POST /bot/send-message
GET /bot/fleets
POST /bot/fleets/:fleetID/cancel
GET /bot/attacks
GET /bot/galaxy-infos/:galaxy/:system
GET /bot/get-research
GET /bot/planets
GET /bot/planets/:galaxy/:system/:position
GET /bot/planets/:planetID
GET /bot/planets/:planetID/resource-settings
POST /bot/planets/:planetID/resource-settings
GET /bot/planets/:planetID/resources-buildings
GET /bot/planets/:planetID/defence
GET /bot/planets/:planetID/ships
GET /bot/planets/:planetID/facilities
POST /bot/planets/:planetID/build/:ogameID/:nbr
POST /bot/planets/:planetID/build/cancelable/:ogameID
POST /bot/planets/:planetID/build/production/:ogameID/:nbr
POST /bot/planets/:planetID/build/building/:ogameID
POST /bot/planets/:planetID/build/technology/:ogameID
POST /bot/planets/:planetID/build/defence/:ogameID/:nbr
POST /bot/planets/:planetID/build/ships/:ogameID/:nbr
GET /bot/planets/:planetID/production
GET /bot/planets/:planetID/constructions
POST /bot/planets/:planetID/cancel-building
POST /bot/planets/:planetID/cancel-research
GET /bot/planets/:planetID/resources
POST /bot/planets/:planetID/send-fleet

Set user-agent

POST /bot/set-user-agent

curl 127.0.0.1:8080/bot/set-user-agent -d 'userAgent="new user agent"'

Result:

{"Status":"ok","Code":200,"Message":"","Result":null}

Get server

GET /bot/server

curl 127.0.0.1:8080/bot/server

Result:

{
	"Status": "ok",
	"Code": 200,
	"Message": "",
	"Result": {
		"Language": "en",
		"Number": 152,
		"Name": "Zibal",
		"PlayerCount": 1080,
		"PlayersOnline": 51,
		"Opened": "2018-03-22T12:18:23+0000",
		"StartDate": "2018-03-22T12:18:23+0000",
		"EndDate": null,
		"ServerClosed": 0,
		"Prefered": 1,
		"SignupClosed": 0,
		"Settings": {
			"AKS": 1,
			"FleetSpeed": 2,
			"WreckField": 1,
			"ServerLabel": "empty",
			"EconomySpeed": 7,
			"PlanetFields": 25,
			"UniverseSize": 6,
			"ServerCategory": "balanced",
			"EspionageProbeRaids": 0,
			"PremiumValidationGift": 25000,
			"DebrisFieldFactorShips": 70,
			"DebrisFieldFactorDefence": 0
		}
	}
}

Get server URL

curl 127.0.0.1:8080/bot/server-url
{"Status":"ok","Code":200,"Message":"","Result":"https://s152-en.ogame.gameforge.com"}

Get language

curl 127.0.0.1:8080/bot/language
{"Status":"ok","Code":200,"Message":"","Result":"en"}

Login

curl 127.0.0.1:8080/bot/login
{"Status":"ok","Code":200,"Message":"","Result":null}

Logout

curl 127.0.0.1:8080/bot/logout
{"Status":"ok","Code":200,"Message":"","Result":null}

Get universe speed

curl 127.0.0.1:8080/bot/server/speed
{"Status":"ok","Code":200,"Message":"","Result":7}

Get universe speed fleet

curl 127.0.0.1:8080/bot/server/speed-fleet
{"Status":"ok","Code":200,"Message":"","Result":2}

Get ogame server version

curl 127.0.0.1:8080/bot/server/version
{"Status":"ok","Code":200,"Message":"","Result":"6.7.2-pl4"}

Get ogame server time

curl 127.0.0.1:8080/bot/server/time
{"Status":"ok","Code":200,"Message":"","Result":"2018-09-12T21:33:57+01:00"}

Is under attack

curl 127.0.0.1:8080/bot/is-under-attack
{"Status":"ok","Code":200,"Message":"","Result":false}

Get user infos

curl 127.0.0.1:8080/bot/user-infos
{
	"Status": "ok",
	"Code": 200,
	"Message": "",
	"Result": {
		"PlayerID": 107009,
		"PlayerName": "Constable Telesto",
		"Points": 33439,
		"Rank": 825,
		"Total": 1050,
		"HonourPoints": 0
	}
}

Send message

curl 127.0.0.1:8080/bot/send-message -d 'playerID=123&message="How are you ?"'
{"Status":"ok","Code":200,"Message":"","Result":null}

Get all fleets

curl 127.0.0.1:8080/bot/fleets
{
	"Status": "ok",
	"Code": 200,
	"Message": "",
	"Result": [{
		"Mission": 3,
		"ReturnFlight": false,
		"ID": 5575790,
		"Resources": {
			"Metal": 1,
			"Crystal": 2,
			"Deuterium": 3,
			"Energy": 0,
			"Darkmatter": 0
		},
		"Origin": {
			"Galaxy": 4,
			"System": 212,
			"Position": 8
		},
		"Destination": {
			"Galaxy": 4,
			"System": 208,
			"Position": 8
		},
		"Ships": {
			"LightFighter": 1,
			"HeavyFighter": 2,
			"Cruiser": 0,
			"Battleship": 0,
			"Battlecruiser": 0,
			"Bomber": 0,
			"Destroyer": 0,
			"Deathstar": 0,
			"SmallCargo": 0,
			"LargeCargo": 0,
			"ColonyShip": 0,
			"Recycler": 0,
			"EspionageProbe": 0,
			"SolarSatellite": 0
		},
		"ArriveIn": 2170
	}]
}

Send a fleet

POST /bot/planets/:planetID/send-fleet

Refer to constants.go to figure out the IDs for mission / speed / ships...

curl 127.0.0.1:8080/bot/planets/123/send-fleet -d 'ships=204,1&ships=205,2&speed=10&galaxy=4&system=208&position=8&mission=3&metal=1&crystal=2&deuterium=3'
{"Status":"ok","Code":200,"Message":"","Result":5575790}

Cancel a fleet

POST /bot/fleets/:fleetID/cancel

curl -XPOST 127.0.0.1:8080/bot/fleets/5575790/cancel
{"Status":"ok","Code":200,"Message":"","Result":null}

Get attacks infos

curl 127.0.0.1:8080/bot/attacks
{"Status":"ok","Code":200,"Message":"","Result":[]}

Get galaxy infos

GET /bot/galaxy-infos/:galaxy/:system

curl 127.0.0.1:8080/bot/galaxy-infos/4/205
{
	"Status": "ok",
	"Code": 200,
	"Message": "",
	"Result": [{
		"ID": 33659802,
		"Activity": 37,
		"Name": "Colony",
		"Img": "https://gf2.geo.gfsrv.net/cdndf/3e567d6f16d040326c7a0ea29a4f41.gif",
		"Coordinate": {
			"Galaxy": 4,
			"System": 205,
			"Position": 8
		},
		"Administrator": false,
		"Inactive": false,
		"Vacation": false,
		"StrongPlayer": true,
		"HonorableTarget": true,
		"Debris": {
			"Metal": 0,
			"Crystal": 0,
			"RecyclersNeeded": 0
		},
		"Moon": {
			"ID":33730993,
			"Diameter":8944,
			"Activity":15
		},
		"Player": {
			"ID": 100606,
			"Name": "Ozon",
			"Rank": 30
		},
		"Alliance": {
			"ID": 8,
			"Name": "POLSKA",
			"Rank": 26,
			"Member": 3
		}
	}]
}

Get researches

curl 127.0.0.1:8080/bot/get-research
{
	"Status": "ok",
	"Code": 200,
	"Message": "",
	"Result": {
		"EnergyTechnology": 4,
		"LaserTechnology": 2,
		"IonTechnology": 0,
		"HyperspaceTechnology": 0,
		"PlasmaTechnology": 0,
		"CombustionDrive": 6,
		"ImpulseDrive": 4,
		"HyperspaceDrive": 0,
		"EspionageTechnology": 7,
		"ComputerTechnology": 8,
		"Astrophysics": 9,
		"IntergalacticResearchNetwork": 0,
		"GravitonTechnology": 0,
		"WeaponsTechnology": 0,
		"ShieldingTechnology": 0,
		"ArmourTechnology": 0
	}
}

Get bot planets

curl 127.0.0.1:8080/bot/planets

Result:

{
	"Status": "ok",
	"Code": 200,
	"Message": "",
	"Result": [{
		"Img": "https://gf1.geo.gfsrv.net/cdnc3/05f9cbd97aef057af87dc00f448bdb.png",
		"ID": 33707619,
		"Name": "Homeworld",
		"Diameter": 12800,
		"Coordinate": {
			"Galaxy": 4,
			"System": 212,
			"Position": 8
		},
		"Fields": {
			"Built": 142,
			"Total": 188
		},
		"Temperature": {
			"Min": 4,
			"Max": 44
		}
	},
	{
		"Img": "https://gf1.geo.gfsrv.net/cdn9e/27d4ab63668a5100879ee5e2d67d78.png",
		"ID": 33711028,
		"Name": "Colony",
		"Diameter": 13904,
		"Coordinate": {
			"Galaxy": 4,
			"System": 208,
			"Position": 8
		},
		"Fields": {
			"Built": 117,
			"Total": 218
		},
		"Temperature": {
			"Min": 20,
			"Max": 60
		}
	}]
}

Get bot planet with coordinates

GET /bot/planets/:galaxy/:system/:position

curl 127.0.0.1:8080/bot/planets/4/208/8

Result:

{
	"Status": "ok",
	"Code": 200,
	"Message": "",
	"Result": {
		"Img": "https://gf1.geo.gfsrv.net/cdn9e/27d4ab63668a5100879ee5e2d67d78.png",
		"ID": 33711028,
		"Name": "Colony",
		"Diameter": 13904,
		"Coordinate": {
			"Galaxy": 4,
			"System": 208,
			"Position": 8
		},
		"Fields": {
			"Built": 117,
			"Total": 218
		},
		"Temperature": {
			"Min": 20,
			"Max": 60
		}
	}
}

Get bot planet by planet ID

GET /bot/planets/:planetID

curl 127.0.0.1:8080/bot/planets/33711028

Result:

{
	"Status": "ok",
	"Code": 200,
	"Message": "",
	"Result": {
		"Img": "https://gf1.geo.gfsrv.net/cdn9e/27d4ab63668a5100879ee5e2d67d78.png",
		"ID": 33711028,
		"Name": "Colony",
		"Diameter": 13904,
		"Coordinate": {
			"Galaxy": 4,
			"System": 208,
			"Position": 8
		},
		"Fields": {
			"Built": 117,
			"Total": 218
		},
		"Temperature": {
			"Min": 20,
			"Max": 60
		}
	}
}

Get planet resources buildings

GET /bot/planets/:planetID/resources-buildings

curl 127.0.0.1:8080/bot/planets/33711028/resources-buildings

Result:

{
	"Status": "ok",
	"Code": 200,
	"Message": "",
	"Result": {
		"MetalMine": 22,
		"CrystalMine": 20,
		"DeuteriumSynthesizer": 17,
		"SolarPlant": 24,
		"FusionReactor": 8,
		"SolarSatellite": 0,
		"MetalStorage": 9,
		"CrystalStorage": 8,
		"DeuteriumTank": 7
	}
}

Get planet facilities

GET /bot/planets/:planetID/facilities

curl 127.0.0.1:8080/bot/planets/33711028/facilities

Result:

{
	"Status": "ok",
	"Code": 200,
	"Message": "",
	"Result": {
		"RoboticsFactory": 2,
		"Shipyard": 0,
		"ResearchLab": 0,
		"AllianceDepot": 0,
		"MissileSilo": 0,
		"NaniteFactory": 0,
		"Terraformer": 0,
		"SpaceDock": 0
	}
}

Get planet defences

GET /bot/planets/:planetID/defence

curl 127.0.0.1:8080/bot/planets/33711028/defence

Result:

{
	"Status": "ok",
	"Code": 200,
	"Message": "",
	"Result": {
		"RocketLauncher": 0,
		"LightLaser": 0,
		"HeavyLaser": 0,
		"GaussCannon": 0,
		"IonCannon": 0,
		"PlasmaTurret": 0,
		"SmallShieldDome": 0,
		"LargeShieldDome": 0,
		"AntiBallisticMissiles": 0,
		"InterplanetaryMissiles": 0
	}
}

Get planet ships

GET /bot/planets/:planetID/ships

curl 127.0.0.1:8080/bot/planets/33711028/ships

Result:

{
	"Status": "ok",
	"Code": 200,
	"Message": "",
	"Result": {
		"LightFighter": 0,
		"HeavyFighter": 0,
		"Cruiser": 0,
		"Battleship": 0,
		"Battlecruiser": 0,
		"Bomber": 0,
		"Destroyer": 0,
		"Deathstar": 0,
		"SmallCargo": 0,
		"LargeCargo": 0,
		"ColonyShip": 0,
		"Recycler": 0,
		"EspionageProbe": 0,
		"SolarSatellite": 0
	}
}

Get planet resources

GET /bot/planets/:planetID/resources

curl 127.0.0.1:8080/bot/planets/33711028/resources

Result:

{
	"Status": "ok",
	"Code": 200,
	"Message": "",
	"Result": {
		"Metal": 497650,
		"Crystal": 276358,
		"Deuterium": 76848,
		"Energy": 349,
		"Darkmatter": 25000
	}
}