| Both sides previous revision Previous revision Next revision | Previous revision |
| rlink:start [2025-02-02 00:34] – nimda | rlink:start [2025-02-02 00:44] (current) – nimda |
|---|
| ====== WorldsEdgeLink API ====== | ====== WorldsEdgeLink API ====== |
| |
| <WRAP center round info 60%> | |
| ===== Age of Empires API Usage Guidelines ===== | ===== Age of Empires API Usage Guidelines ===== |
| |
| Rate Limits and Access Patterns | <WRAP center round important 60%> |
| - The game API has rate limits of approximately 200 requests per minute | Please check the following [[rlink:usage|Age of Empires API Usage Guidelines]] before you design or implement anything. |
| - Rate limit violations trigger a 429 HTTP error | |
| - Recommended configuration: Implement a throttler at 100 requests per 30 seconds for safety | |
| | |
| ==== Recommended Access Patterns ==== | |
| | |
| - Safe to access: | |
| - Ongoing games | |
| - Match histories | |
| - Leaderboards | |
| | |
| ==== Optimization Strategy ==== | |
| | |
| Use a dual-API approach: | |
| 1. Game API | |
| - Primary use: Fetching ongoing observable games | |
| - Expected usage: 10-15 requests per minute | |
| 2. Community API | |
| - Use for match histories and leaderboards | |
| - Benefits from higher rate limits | |
| - Reduces load on main game API | |
| | |
| ==== Actions to Avoid ==== | |
| | |
| - Accessing chat channels | |
| - Accessing presence-related features | |
| - Making POST requests | |
| - Creating lobbies via API | |
| - Any other write operations | |
| | |
| ==== Error Handling ==== | |
| | |
| Implement logging for rate limit errors (HTTP 429) to monitor API usage patterns | |
| </WRAP> | </WRAP> |
| |
| |
| ==== Endpoints ==== | ==== Endpoints ==== |
| <WRAP round important 100%> | <WRAP round info 100%> |
| [[ aoe:toc | API docs ]] | [[ aoe:toc | API docs ]] |
| </WRAP> | </WRAP> |
| <WRAP round important 100%> | <WRAP round important 100%> |
| Some stuff is zlib-compressed. E.g. inside <code>slotinfo</code> there's a <code>metaData</code> field that seem to be a **two-pass base64 string holding binary data** | Some stuff is zlib-compressed. E.g. inside <code>slotinfo</code> there's a <code>metaData</code> field that seem to be a **two-pass base64 string holding binary data** |
| Couldn't deduce options yet. It's zlib as well, but the uncompressed string looks different, it's not base64(?) | |
| | Example |
| | |
| | Heres an example from the slotinfo property: |
| | |
| | <code>$ echo 'eNrVkF1PwjAUhv0tvR6GMjYniTeDVWfcgLJ2gvGibl0o3QduEyHG/y6dgUiMF8YLs6uevufknCcP7GkPb2BdFolIuZsnxbmIwcCyTN0yLzVQ1awWRe6OwABqoOYsU2VXAwmLDo39r2QRP5a5vOMbnh5/HqujZbBbNxMdtUZkfMJLVLKMe7NmTlSYs3jXXFE3X6omznjNRqxmYABceWtjguwpQf1pGKvXCe6XNmkybM+6TW+MHQkDiUtPGuYsoGMiocqHFMkdzekidNav8xUaRjCdP11vV6y3haGMQ9/x8/2cjREyAoixT4znuZ5OKKJI5VO6uKHZUhBC1T7bE+4VeNe+u+vAE22dL97giTfVOYj7rP9krvuTud9S9lpBqbeCst8KSqMVlGYrKC/+ifLx7APyMc1P' | base64 -d | zlib-flate -uncompress |
| | |
| | 12,[{"profileInfo.id":8863869,"stationID":1,"teamID":0,"factionID":0,"raceID":0,"rankLevel":0,"rankMatchTypeID":-1,"timePerFrameMS":0,"isReady":1,"status":0,"metaData":"IkJBRUFBQUF4QWdBQUFETXhBUUFBQURBS0FBQUFOREk1TkRrMk56STVOUk1BQUFCVFkyVnVZWEpwYjFCc1lYbGxja2x1WkdWNENnQUFBRFF5T1RRNU5qY3lPVFVFQUFBQVZHVmhiUUVBQUFBMiI="},{"profileInfo.id":-1,"stationID":-1,"teamID":1,"factionID":-1,"raceID":-1,"rankLevel":0,"rankMatchTypeID":-1,"timePerFrameMS":0,"isReady":0,"status":0,"metaData":""},{"profileInfo.id":-1,"stationID":-1,"teamID":2,"factionID":-1,"raceID":-1,"rankLevel":0,"rankMatchTypeID":-1,"timePerFrameMS":0,"isReady":0,"status":0,"metaData":""},{"profileInfo.id":-1,"stationID":-1,"teamID":3,"factionID":-1,"raceID":-1,"rankLevel":0,"rankMatchTypeID":-1,"timePerFrameMS":0,"isReady":0,"status":0,"metaData":""},{"profileInfo.id":-1,"stationID":-1,"teamID":4,"factionID":-1,"raceID":-1,"rankLevel":0,"rankMatchTypeID":-1,"timePerFrameMS":0,"isReady":0,"status":0,"metaData":""},{"profileInfo.id":-1,"stationID":-1,"teamID":5,"factionID":-1,"raceID":-1,"rankLevel":0,"rankMatchTypeID":-1,"timePerFrameMS":0,"isReady":0,"status":0,"metaData":""},{"profileInfo.id":-1,"stationID":-1,"teamID":6,"factionID":-1,"raceID":-1,"rankLevel":0,"rankMatchTypeID":-1,"timePerFrameMS":0,"isReady":0,"status":0,"metaData":""},{"profileInfo.id":-1,"stationID":-1,"teamID":7,"factionID":-1,"raceID":-1,"rankLevel":0,"rankMatchTypeID":-1,"timePerFrameMS":0,"isReady":0,"status":0,"metaData":""}] |
| | </code> |
| | |
| | There are also options, that use <code>b64(zlib(b64(data)))</code> |
| </WRAP> | </WRAP> |
| |