DeletedUser
Guest
Hi guys is there going to be an exported world data/api as in tribal wars? I used to use this for my own map tools etc and would love to use this for this game to.
I don't see any world data at that link, its not found......
Grepolis - World Data
We have written this small guide for other developers who wish to utilise the Grepolis World Data to create their own websites. A good example of what this data can be used to do is Grepo Stats. All data is currently available in the JSON format. Currently world data is updated hourly. Each world's data will be updated at a random starting minute.
Note: Please use the compressed world data whenever possible.
Player data
- players.json
- players.json.gz
The player data contains the following information:
* id - The internal ID of the player
* name - The player's name
* alliance_id - The player's internal alliance ID (see alliances.json)
* points - The player's current amount of points
* rank - The player's current rank
* towns - The player's current amount of cities
Alliance data
- alliances.json
- alliances.json.gz
The alliance data contains the following information:
* id - The internal ID of the alliance
* name - The alliances's name
* points - The alliance's current amount of points
* rank - The alliance's current rank
* towns - The alliances's current amount of cities
* members - The alliances's current member count
Town data
- towns.json
- towns.json.gz
The town data contains the following information:
* id - The internal ID of the town
* player_id - The owner of the town. NULL if no owner
* name - The town's name
* island_x - The X coordinate of the island the town is on
* island_y - The Y coordinate of the island the town is on
* number_on_island - The position of the town on it's island
* points - The town's points
Island data *large file*
- islands.json
- islands.json.gz
The islands data file contains the information for the world's islands. Please note that this is a large file and that once a world has started, it's contents will not change. Therefore, you do not need to keep downloading this file!
The island data contains the following information:
* id - The internal ID of the island
* x - The X position of the island
* y - The Y position of the island
* island_id - The internal number of the island, or, what 'type/size/shape' of island this is. 1-10 = player islands with farm towns, 11-16 = uninhabited islands, 17-21 = rocks
Player kill data
- player_kills.json
- player_kills.json.gz
The player kill data contains information about the player 'kill' ranking. There is a record for each player who is ranked. Each record is an array of objects, with the keys 'all', 'att', 'def'. These keys mean: 'Overall', 'As attacker', 'As defender'.
Each of the aforementioned objects contain the following data:
* rank - The rank for the specific type
* player_id - The internal ID of the player
* points - The points/score
Alliance kill data
- alliance_kills.json
- alliance_kills.json.gz
The alliance kill data contains information about the alliance 'kill' ranking. There is a record for each alliance that is ranked. Each record is an array of objects, with the keys 'all', 'att', 'def'. These keys mean: 'Overall', 'As attacker', 'As defender'.
Each of the aforementioned objects contain the following data:
* rank - The rank for the specific type
* alliance_id - The internal ID of the alliance
* points - The points/score
Colonisation data
- conquers.json
- conquers.json.gz
The colonisation data contains the following information:
* town_id - The town's internal ID
* time - The UNIX timestamp of the conquer
* new_player_id - The player who colonised the town
* old_player_id - If involved, the player who lost the town. Otherwise, NULL
* new_ally_id - If in an alliance, the alliance ID of the player who colonised the town. Otherwise, NULL
* old_ally_id - If in an alliance, the alliance ID of the player who lost the town. Otherwise, NULL
* town_points - The town's points at the time of the colonisation
Building, unit and research information
- units.json
- units.json.gz
- buildings.json
- buildings.json.gz
- researches.json
- researches.json.gz
Legend of a fella
That info will be of great help to many people and will bring about some very useful new tools
{"militia":{"id":"militia","attack_type":"pierce","attack":2,"def_hack":3,"def_pierce":4,"def_distance":2,"speed":0,"resources":null,"favor":0,"population":0,"kill_points":0,"build_time":1,"god_id":null,"research_dependencies":null,"building_dependencies":null,"description":"Militia","name":"Militia"},"sword":{"attack_type":"hack","attack":5,"def_hack":14,"def_pierce":8,"def_distance":30,"booty":16,"speed":8,"resources":{"wood":95,"stone":0,"iron":85},"favor":0,"population":1,"kill_points":1,"build_time":1080,"god_id":null,"research_dependencies":[],"building_dependencies":null,"id":"sword","description":"Swordsmen form your city's basic defense: weak at attacking, very good at defending against remote warriors and good against blunt weapons, inexpensive unit.","name":"Swordsman"}}
I assume you are able to do it and have probably done the same for tw before, but if you can't let me know and I will put together an example filelol well I cant take credit for the info I just found it and guessed the correct url for our world
Now I just need to have a play with importing the JSON files into an SQL database all good fun
Open it in a normal text editor.How can I open JSON files then?
$dataFile = file_get_contents('http://en1.grepolis.net/data/units.json');
$data = json_decode($dataFile);
echo "<pre>";
print_r($data);
echo "</pre>";
Its almost exactly the same as how you upload, write and read the data as in tw.Ok a question how woulsd you use this like you would the tw data through mysql etc?
Its almost exactly the same as how you upload, write and read the data as in tw.
The only difference is this is json and Squelch has told you how to handle that above.