Getting message "No API key found in request"

Hate to bother you guys but I’m having some issues when trying to get responses from the API

I’m currently working in javascript and I keep getting this error despite having the API key set in the headers
this is how I am performing the request. unfortunately I keep getting the “No API key found in request” response. If you don’t know why this is happening could you provide an example of a functioning javascript query if you have one on hand so I can compare?

    $.ajax({
        type: "GET",
        url: "https://public-api.tracker.gg/v2/csgo/standard/profile/steam/76561198008049283/segments/weapon",
        dataType : 'jsonp',   //you may use jsonp for cross origin request
        crossDomain:true,
        Headers: {
            // 'trn-api-key' : APIkey,
            'TRN-Api-Key': APIkey,
            'Accept': 'application/json',
            'Accept-Encoding': 'gzip'
        },

Hi @vincent_van_goy,

I assume you are using jQuery. In this case, you need to fix the headers property name:

Your variant is Headers while the documentation specifies headers (H vs h).

1 Like

That didn’t fix the issue but I was able to get the request working in python so it must be something up with what I’m doing. I’ll work in python for now and come back to it later. I might end up with a few other questions though so apologies in advance

Thanks!