API%3APublic_Stashes
Old: ChuanHsing 2023-01-24 12:40:48
New: ChuanHsing 2023-01-24 12:41:40
| Old | New | Differences | |
|---|---|---|---|
| 1 | - | # | |
| 1 | + | ## Public stash API | |
| 2 | 2 | ||
| 3 | - | ||
| 3 | + | Before accessing this API, you need to apply the official OAuth form and require scope: `service:psapi`. | |
| 4 | 4 | ||
| 5 | - | ||
| 5 | + | [Public stash API](https://www.pathofexile.com/developer/docs/reference#publicstashes) doesn't contain any historical data and always returns the current state of stash tabs. Using ajax from a browser got blocked by CORS, you need to setup a basic proxy to fetch it. | |
| 6 | 6 | ||
| 7 | - | ### Find the POESESSID in Chrome or Edge | |
| 7 | + | Every request will return a `next_change_id` and put it on next `id=` parameter. You will fetch the Json by sequence, for example | |
| 8 | + | ``` | |
| 9 | + | http://www.pathofexile.com/api/public-stash-tabs | |
| 10 | + | http://www.pathofexile.com/api/public-stash-tabs?id=342209785-336957592-338826328 | |
| 11 | + | http://www.pathofexile.com/api/public-stash-tabs?id=342209792-336957596-338826330 | |
| 12 | + | http://www.pathofexile.com/api/public-stash-tabs?id=342209797-336957599-338826336 | |
| 13 | + | ``` | |
| 8 | 14 | ||
| 9 | - | ||
| 15 | + | Using deflate parameter in request header will save a lot of traffic. | |
| 10 | 16 | ||
| 11 | - | * Login to pathofexile.com | |
| 12 | - | * Press F12 to open the Dev Tool | |
| 13 | - | * Click the Application tab | |
| 14 | - | * Expand the Cookies dropdown and select pathofexile.com | |
| 15 | - | * Double click the POESESSID Value and copy | |
| 17 | + | ### Rate Limit | |
| 16 | 18 | ||
| 17 | - |  | |
| 19 | + | Be aware there is a [rate limit](https://www.pathofexile.com/forum/view-thread/2079853#p15244273). | |
| 20 | + | ||
| 21 | + | ``` | |
| 22 | + | curl -XGET -s -D - http://www.pathofexile.com/api/public-stash-tabs | grep -i 'x-rate-limit' | |
| 23 | + | ``` | |
| 24 | + | ||
| 25 | + | ### Next change id | |
| 26 | + | ||
| 27 | + | You can get latest change id at https://poe.ninja/stats |