OpenCritic API

פרמיום
על ידי OpenCritic | מְעוּדכָּן hace un mes | Gaming
פּוֹפּוּלָרִיוּת

9.8 / 10

חֶבִיוֹן

237ms

רמת שירות

100%

Health Check

N/A

חזרה לכל הדיונים

"API Request failed due to Provider configuration error" from Apps Script

Rapid account: Supermonkey
supermonkey
hace 2 años

Hi,

I keep a private Google Sheet which fetches OpenCritic scores for the games in my backlog using Apps Script. Today I started getting errors due to not having an API key, so I signed up here for a free key.

Everything seems to work fine from Curl, and I can repeat the same request a few times without ever encountering a failure.

$  curl --verbose 'https://opencritic-api.p.rapidapi.com/game/8168'   -H 'x-rapidapi-host: opencritic-api.p.rapidapi.com'   -H 'x-rapidapi-key: <redacted>'

However, when I try the same thing using a bit of Apps Script:

var url = 'https://opencritic-api.p.rapidapi.com/game/8168';
  var params = {
    'headers': {
      'x-rapidapi-host': 'opencritic-api.p.rapidapi.com',
      'x-rapidapi-key': '<redacted>',
    },
    'muteHttpExceptions': true
  };
  var response = UrlFetchApp.fetch(url, params);

I get one of two failures. About 50% of the time, I get an error, “You have exceeded the rate limit per second for your plan, BASIC, by the API provider”. (This is despite the above Curl command reporting x-ratelimit-requests-remaining: 198 in the response headers). The rest of the time, I get:

“API Request failed due to Provider configuration error: The API response body transformation failed to parse content-type application/json. Please contact the API Provider”,“info”: “Your Client (working) —> Gateway (working) —> API (not working)”

Given that it’s working from Curl, I’m not sure why this would be any different. I double checked the API key is identical in both systems. The error seems to indicate something wrong on the API side but I’m not sure what. Would someone be able to help here?

Thanks!

Rapid account: Supermonkey
supermonkey Commented hace 2 años

Confirmed - it is working fine for me now. Thanks!

Rapid account: Joekw 3
joekw3 Commented hace 2 años

I’ve spoken to OpenCritic and this should be fixed now.

Rapid account: Joekw 3
joekw3 Commented hace 2 años

I get the same error:

502 Bad Gateway
"message": “API Request failed due to Provider configuration error: The API response body transformation failed to parse content-type application/json. Please contact the API Provider”,
“info”: “Your Client (working) —> Gateway (working) —> API (not working)”

הצטרף לדיון - הוסף תגובה למטה:

התחבר / הירשם כדי לפרסם תגובות חדשות