acupoftee/Overwatch-League-API-Documentation

New 2019 Maps are not stored in API

ranamerp opened this issue ยท 4 comments

When trying to call new maps introduced in the 2019 season, the map name is not recorded. Here is the code I used to collect data from the API.

`matches = requests.get("https://api.overwatchleague.com/matches/21341")
m = json.loads(matches.text)
#Getting Match Data
def get_match_data(m):
try:
map_1_name = m["games"][0]["attributes"]["map"]
except KeyError:
map_1_name = "None"
map_1_type = MAP_TYPE.get(map_1_name)
map_1_away_points = m["games"][0]["points"][0]
map_1_home_points = m["games"][0]["points"][1]

try:
    map_2_name = m["games"][1]["attributes"]["map"]
except KeyError:
    map_2_name = "None"
map_2_type = MAP_TYPE.get(map_2_name)
map_2_away_points = m["games"][1]["points"][0]
map_2_home_points = m["games"][1]["points"][1]

try:
    map_3_name = m["games"][2]["attributes"]["map"]
except KeyError:
    map_3_name = "None"
map_3_type = MAP_TYPE.get(map_3_name)
map_3_away_points = m["games"][2]["points"][0]
map_3_home_points = m["games"][2]["points"][1]

try:
    map_4_name = m["games"][3]["attributes"]["map"]
except KeyError:
    map_4_name = "None"
map_4_type = MAP_TYPE.get(map_4_name)
map_4_away_points = m["games"][3]["points"][0]
map_4_home_points = m["games"][3]["points"][1]

try:
    map_5_name = m["games"][4]["attributes"]["map"]
    map_5_type = MAP_TYPE.get(map_5_name)
    map_5_away_points = m["games"][4]["points"][0]
    map_5_home_points = m["games"][4]["points"][1]
except (IndexError, KeyError) as e:
    map_5_name = "N/A"
    map_5_type = "N/A"
    map_5_away_points = "N/A"
    map_5_home_points = "N/A"
print("Map 1 Data: ", map_1_name, map_1_type, map_1_away_points, map_1_home_points)
print("Map 2 Data: ",map_2_name, map_2_type, map_2_away_points, map_2_home_points)
print("Map 3 Data: ",map_3_name, map_3_type, map_3_away_points, map_3_home_points)
print("Map 4 Data: ",map_4_name, map_4_type, map_4_away_points, map_4_home_points)
print("Map 5 Data: ",map_5_name, map_5_type, map_5_away_points, map_5_home_points)

`
This calls the Vancouver-Houston game specifically. Here is the response from the API.

Map 1 Data: None None 0 2 Map 2 Data: None None 1 0 Map 3 Data: eichenwalde Hybrid 2 1 Map 4 Data: None None 1 0 Map 5 Data: N/A N/A N/A N/A

Compare that to the London-Shanghai game and we get:
Map 1 Data: nepal Control 2 0 Map 2 Data: kings-row Hybrid 0 3 Map 3 Data: temple-of-anubis Assault 1 0 Map 4 Data: route-66 Escort 0 3 Map 5 Data: ilios Control 1 2

Looking at the Vancouver-Houston game on the website, we see:
heck

3 maps which are new to 2019 were played, but not recorded by the API.

I just ran into this too ๐Ÿ™ƒ

I just ran into this too ๐Ÿ™ƒ

One thing I did was find the GUIDs of the maps and convert those, as those were scored. They should be in the match endpoint for whatever match youโ€™re trying to call. Hereโ€™s my dictionary of maps I created:

`
GUID_TO_MAP_NAME = {
'0x0800000000000B56': 'havana',
'0x080000000000005B': 'temple-of-anubis',
'0x08000000000000D4': 'kings-row',
'0x0800000000000165': 'hanamura',
'0x0800000000000184': 'gibraltar',
'0x08000000000001D4': 'numbani',
'0x08000000000001DB': 'volskaya',
'0x08000000000002AF': 'hollywood',
'0x08000000000002C3': 'dorado',
'0x08000000000004B7': 'nepal',
'0x08000000000005BB': 'route-66',
'0x0800000000000661': 'tutorial',
'0x0800000000000662': 'lijiang',
'0x080000000000066D': 'illios',
'0x0800000000000688': 'practice-range',
'0x080000000000068D': 'eichenwalde',
'0x080000000000069E': 'oasis',
'0x08000000000006AB': 'hollywood',
'0x08000000000006B1': 'kings-row',
'0x08000000000006B3': 'estadio-das-ras',
'0x08000000000006B5': 'hanamura',
'0x08000000000006B7': 'lijiang',
'0x08000000000006C7': 'vpp-green-room',
'0x08000000000006C9': 'junkenstein',
'0x08000000000006D1': 'ecopoint',
'0x08000000000006D3': 'horizon-lunar-colony',
'0x08000000000006FE': 'kings-row',
'0x0800000000000705': 'necropolis',
'0x080000000000070C': 'black-forest',
'0x080000000000070D': 'ecopoint',
'0x0800000000000711': 'lijiang-garden',
'0x0800000000000712': 'lijiang-night-market',
'0x0800000000000717': 'nepal-sanctum',
'0x080000000000071A': 'lijiang-control-center',
'0x080000000000071C': 'castillo',
'0x0800000000000736': 'nepal-village',
'0x0800000000000738': 'nepal-shrine',
'0x080000000000073A': 'illios-well',
'0x080000000000073D': 'illios-lighthouse',
'0x080000000000073E': 'illios-ruins',
'0x0800000000000744': 'lijiang-control-center',
'0x0800000000000745': 'lijiang-garden',
'0x0800000000000746': 'lijiang-night-market',
'0x080000000000074A': 'oasis-city-center',
'0x080000000000074C': 'oasis-garden',
'0x080000000000074D': 'oasis-university',
'0x0800000000000751': 'numbani',
'0x0800000000000756': 'junkertown',
'0x080000000000075E': 'blizzard-world',
'0x0800000000000793': 'sydney',
'0x080000000000079F': 'rialto',
'0x08000000000007A1': 'ayutthaya',
'0x08000000000007A4': 'chateau-guillard',
'0x08000000000007E2': 'busan',
'0x08000000000007F4': 'eichenwalde',
'0x08000000000007F7': 'black-forest',
'0x08000000000007FD': 'nepal-village',
'0x0800000000000801': 'junkertown',
'0x0800000000000836': 'chateau-guillard',
'0x080000000000083B': 'oasis',
'0x080000000000083E': 'blizzard-world',
'0x080000000000085F': 'black-forest',
'0x0800000000000871': 'rialto',
'0x080000000000088C': 'eichenwalde',
'0x0800000000000890': 'petra',
'0x0800000000000891': 'paris',
'0x08000000000008B4': 'rialto',
'0x08000000000008BE': 'rialto',
'0x080000000000092A': 'busan-stadium',
'0x0800000000000A14': 'busan',
'0x0800000000000A42': 'busan',
'0x0800000000000A44': 'havana',
'0x0800000000000A5A': 'chateau-guillard',
'0x0800000000000A5B': 'blizzard-world',
'0x0800000000000A7A': 'busan-sanctuary',
'0x0800000000000A84': 'route-66',
'0x0800000000000A86': 'busan-downtown',
'0x0800000000000A9E': 'blizzard-world',
'0x0800000000000AF0': 'paris',
'0x0800000000000AFE': 'havana',
'0x0800000000000B55': 'havana'

}

`

Oh my goodness - was just starting to do this manually -- thank you so much for sharing!!! ๐Ÿ˜๐Ÿ˜๐Ÿ˜๐Ÿ˜

No problem! Just a heads up, some of those repeat map ids are for control/elimination map types. They even having training room in there!