Jump to content

Trying to use backpack tf API for price checking with python


Myst1cS04p

Recommended Posts

So, ive never used the bp tf api before but i wanted to set it up so that i could get the lowest sell order from the classifieds of an item. Sounds simple enough right? but its not. I tried using the python requests module but i couldnt figure out how to use that to get the prices and stuff since every time i sent a request it just told me i couldn't do it, so i found this other library https://pypi.org/project/BackpackTF/ made specifically for bp tf. However to use the classifieds methods i need to set up a constructer for BackpackTF.Account. On the documentation of the backpack tf library it said for setting up account i had to provide client id, client secret, and api key. The only one of these things i have in the api key and idk where to find the others. help would be much appreciated 

  • Like 1
Link to comment
Share on other sites

30 minutes ago, Myst1cS04p said:

So, ive never used the bp tf api before but i wanted to set it up so that i could get the lowest sell order from the classifieds of an item. Sounds simple enough right? but its not. I tried using the python requests module but i couldnt figure out how to use that to get the prices and stuff since every time i sent a request it just told me i couldn't do it, so i found this other library https://pypi.org/project/BackpackTF/ made specifically for bp tf. However to use the classifieds methods i need to set up a constructer for BackpackTF.Account. On the documentation of the backpack tf library it said for setting up account i had to provide client id, client secret, and api key. The only one of these things i have in the api key and idk where to find the others. help would be much appreciated 

Oooh this seems pretty neat!

Link to comment
Share on other sites

Alright thanks for the heads up. Could u also tell me how I should pass the api key? I am using the requests pakage in python. I have tried having it setup so that i send a request to backpack.tf/[appropriate api command url]?token=[api key] but that didnt work and i have tried having the api key as the auth parameter for my request. Help is much appreciated 

Link to comment
Share on other sites

56 minutes ago, Myst1cS04p said:

Alright thanks for the heads up. Could u also tell me how I should pass the api key? I am using the requests pakage in python. I have tried having it setup so that i send a request to backpack.tf/[appropriate api command url]?token=[api key] but that didnt work and i have tried having the api key as the auth parameter for my request. Help is much appreciated 

The snapshots api requires your user token and uses token=abc. For apis that use the api key use the key=abc parameter

Link to comment
Share on other sites

15 minutes ago, Zeus_Junior said:

The snapshots api requires your user token and uses token=abc. For apis that use the api key use the key=abc parameter

Tysm man ur super helpful

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...