TrackerNetwork / TRN.Developers

Information and Issue Tracker for the Tracker Network API.
https://tracker.gg/developers
24 stars 5 forks source link

Splitgate api python not working... #59

Closed Mo18769 closed 5 months ago

Mo18769 commented 3 years ago

Thats my code:


from requests.auth import HTTPBasicAuth import requests import json import discord

user = "76561199007449539"

url = "https://public-api.tracker.gg/v2/splitgate/standard/profile/steam/" +user headers = {'Accept': 'application/json'} auth = HTTPBasicAuth('TRN-Api-Key', 'MY_API_KEY')

response = requests.get(url, headers=headers, auth=auth) print(response.text)


output = "{"message":"No API key found in request"}"

Anyboy know why this isnt working?

SquatchHunter commented 3 years ago

Hey Mo18769, You have misread the docs and included your API key in the wrong part of the call try doing the following;

url = "https://public-api.tracker.gg/v2/splitgate/standard/profile/steam/" +user
headers = {
    'Accept': 'application/json',
    'TRN-Api-Key' : '{YOUR_KEY_HERE}'
}

For further assistance and for a faster response time feel free to join our discord and use the #trn-api channel, we have plenty of friendly community members who will try their best to assist you :) https://discord.com/invite/trackernetwork

Thanks, Squatch_ Community Support & Discord Admin for TheTrackerNetwork

edit: missed a coma

Mo18769 commented 3 years ago

Thanks