Skip to content

Instantly share code, notes, and snippets.

@mninc
Created April 28, 2018 15:33
Show Gist options
  • Select an option

  • Save mninc/a2449ee523d467e2e5373e6a687876a4 to your computer and use it in GitHub Desktop.

Select an option

Save mninc/a2449ee523d467e2e5373e6a687876a4 to your computer and use it in GitHub Desktop.
import requests
from time import sleep
api_key = ""
hats = ["Herald's Helm", "Brotherhood of Arms", "Modest Pile of Hat"]
print("Parameters in query string:")
for item in hats:
print(requests.get("https://backpack.tf/api/classifieds/search/v1", params={"key": api_key, "item": item}).json())
sleep(5)
print("Parameters in body:")
for item in hats:
print(requests.get("https://backpack.tf/api/classifieds/search/v1", data={"key": api_key, "item": item}).json())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment