Not_a_good_sniper Posted December 16, 2020 Share Posted December 16, 2020 Decided to learn how to get listings for some items like keys to update a keys to ref ratio or update prices for other items like paints or strange parts, but I have got a problem My requests are failing: error 403. Is this api broken? I think my code is fine, bc same code works ok with other api, like 'get my listings' Getting my listings: const options = { params: { token: token } }; axios.get("https://backpack.tf/api/classifieds/listings/v1", options) .then(res => { console.log("Response: ", res.data.listings); }) .catch(err => { console.log(err); }) // Output: Response: [] (my alt accound don't have any listings) Using classified search: const options2 = { params: { key: token } }; axios.get('https://backpack.tf/api/classifieds/search/v1', options2) .then(res => { console.log(res) }).catch(err => { console.log(err); }); // Output: Error: Request failed with status code 403 P.s I heard bots are using a web site which is actually pricing items, but I don't think using any 3rd party web sites is a good idea Link to comment Share on other sites More sharing options...
Zeus_Junior Posted December 16, 2020 Share Posted December 16, 2020 That is because your user token is not your api key, request your api key here https://backpack.tf/developer/apikey/view The classifieds search api requires elevated access. Elevated requests are handled in batches, so it may take an hour or 3 days to be handled. Link to comment Share on other sites More sharing options...
Not_a_good_sniper Posted December 16, 2020 Author Share Posted December 16, 2020 35 minutes ago, Zeus_Junior said: That is because your user token is not your api key, request your api key here https://backpack.tf/developer/apikey/view The classifieds search api requires elevated access. Elevated requests are handled in batches, so it may take an hour or 3 days to be handled. Ok got it, thanks. I thought api key is for web sites only and classified search API does not require an api key bc it is in the user-token-classifieds folder. Should I register my api key using my main account or a bot's one? Or doesn't matter? Link to comment Share on other sites More sharing options...
Mengh. Posted December 16, 2020 Share Posted December 16, 2020 16 minutes ago, Not_a_good_sniper said: Ok got it, thanks. I thought api key is for web sites only and classified search API does not require an api key bc it is in the user-token-classifieds folder. Should I register my api key using my main account or a bot's one? Or doesn't matter? Yeah, the documentation is unfortunately a bit all over the place. Doesn't really matter which account you have the API key for. Link to comment Share on other sites More sharing options...
Zeus_Junior Posted December 16, 2020 Share Posted December 16, 2020 Use this userscript to have links to some still existing docs on the /developer pages, I wouldn't rely on the Swagger UI docs Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.