match_id: How do you get it?
Rivenweye.8930:
Hi everyone! I’m really very new to Python and API queries and I just wanted to practice learning about these using GW2 API. I just wanted to ask two questions, if you don’t mind:
1. Where could I learn more about Python-specific notes about accessing the GW2 API?
2. In the match details API for WvW, what’s the match_id and how do I get it? I can access the JSON by mucking around with urllib2 (and by guessing a match_id) but I don’t really know what match it was referring to. (Note: I used 2-7 for the match_id). Can you guys help?
Again, I’m very new so pardon the noobish questions. Thanks in advance!
Varonth.5830:
You are using the match_details.json interface.
There are alot of interfaces (see sticky thread or the wiki ).
One of them is is matches.json . That one lists all current matches, with some additional data like involved worlds (just Ids again, there is another interface for those) start and end time.
Dr Ishmael.9685:
Check out the API/Libraries page on the wiki, there are a few Python libraries listed there that other people have already written.
Rivenweye.8930:
@Varonth – Thanks, that did it. I was looking at the wrong places lol.
@Dr Ishmael – This is a great list, thanks! I really want to do something like this (for Python) for a personal mini-project. Still learning though, but hope I get there.
rodadams.5963:
btw, in Python, you can just use urllib2 to pull down the url, and then use eval to convert it into a nested dict/list structure.
zeeZ.5713:
use eval
You don’t use eval. Ever.
Python’s JSON module works just fine, and there are others like it