FreeMcServer

FREE
By nfacha | Updated 17 giorni fa | Gaming
Popularity

8.3 / 10

Latency

515ms

Service Level

100%

Health Check

N/A

Back to All Discussions

403 error in python requests example

Rapid account: Andresviro 15
andresviro15
8 mesi fa

I try to use your API in my python app.

I use requests, but in response, I see only 403 error even in requests example.
Example code:

import requests

url = “https://freemcserver.p.rapidapi.com/v4/user

headers = {
“X-FMCS-Token”: “XXX”,
“X-RapidAPI-Key”: “XXX”,
“X-RapidAPI-Host”: “freemcserver.p.rapidapi.com
}

response = requests.get(url, headers=headers)

print(response.json())

Response:

{
“x-ratelimit-rapid-free-plans-hard-limit-limit”: “500000”,
“cache-control”: “no-store, no-cache, must-revalidate”,
“referrer-policy”: “no-referrer-when-downgrade”,
“x-ratelimit-requests-remaining”: “163”,
“origin”: “",
“expires”: “Thu, 19 Nov 1981 08:52:00 GMT”,
“x-rapidapi-region”: “AWS - us-east-1”,
“access-control-request-method”: “POST, GET”,
“x-rapidapi-version”: “1.2.8”,
“access-control-allow-credentials”: “true”,
“transfer-encoding”: “chunked”,
“access-control-expose-headers”: “x-ratelimit-limit, x-ratelimit-remaining, x-ratelimit-reset, access-control-allow-origin, accept-ranges, age, allow, cache-control, connection, content-encoding, content-language, content-length, content-location, content-md5, content-disposition, content-range, content-type, date, etag, expires, last-modified, link, location, p3p, pragma, proxy-authenticate, refresh, retry-after, server, set-cookie, status, strict-transport-security, trailer, transfer-encoding, upgrade, vary, via, warning, www-authenticate, x-frame-options, public-key-pins, x-xss-protection, content-security-policy, x-content-security-policy, x-webkit-csp, x-content-type-options, x-powered-by, x-ua-compatible, X-RateLimit-Requests-Limit, X-RateLimit-Requests-Remaining, X-RateLimit-Requests-Reset, X-RateLimit-rapid-free-plans-hard-limit-Limit, X-RateLimit-rapid-free-plans-hard-limit-Remaining, X-RateLimit-rapid-free-plans-hard-limit-Reset, x-ratelimit-rapid-free-plans-hard-limit-limit, referrer-policy, x-ratelimit-requests-remaining, origin, x-rapidapi-region, access-control-request-method, x-rapidapi-version, access-control-allow-credentials, nel, x-ratelimit-rapid-free-plans-hard-limit-remaining, x-ratelimit-rapid-free-plans-hard-limit-reset, x-ratelimit-requests-reset, x-ratelimit-requests-limit, cf-ray, access-control-allow-headers, cf-cache-status, report-to, alt-svc”,
“content-type”: “application/json; charset=UTF-8”,
“connection”: “close”,
“nel”: “{“success_fraction”:0,“report_to”:“cf-nel”,“max_age”:604800}”,
“x-ratelimit-rapid-free-plans-hard-limit-remaining”: “499963”,
“server”: “RapidAPI-1.2.8”,
“x-ratelimit-rapid-free-plans-hard-limit-reset”: “2672217”,
“x-ratelimit-requests-reset”: “80217”,
“x-ratelimit-requests-limit”: “200”,
“x-xss-protection”: “1; mode=block”,
“x-content-type-options”: “nosniff”,
“x-frame-options”: “SAMEORIGIN”,
“content-security-policy”: “default-src * data: ‘unsafe-eval’ ‘unsafe-inline’”,
“vary”: “Accept-Encoding”,
“cf-ray”: “7fbdc0acef912899-IAD”,
“access-control-allow-headers”: “Authorization,DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization,X-FMCS-Token”,
“pragma”: “no-cache”,
“cf-cache-status”: “DYNAMIC”,
“set-cookie”: “api=eb2pb0uq34gdusj2mk05ae9u4v; path=/; HttpOnly”,
“report-to”: “{“endpoints”:[{“url”:“https:\/\/a.nel.cloudflare.com\/report\/v3?s=MJ9JtqJeL97t%2F3FpPDVBPOZPabpMpSoJNW%2BLjzAXACLXGgi2pjv04S7pSdsysppDstaWJJxJLDCWvWD9dy1PB9zgDoIOxQQXacFmByqNwNs42mRiG8%2FV9H2TN5dCJZEcpPvzowhKGwbPjj8%3D”}],“group”:“cf-nel”,“max_age”:604800}”,
“alt-svc”: “h3=”:443"; ma=86400",
“access-control-allow-origin”: "

}

{
“success”: false,
“error”: “Invalid user agent, please set the user agent to FMCS-USER-330367”
}

Rapid account: Sn 0 Wix
Sn0wix Commented 5 mesi fa

I get the same error. You need to add header “User-Agent”, “your_user_agent”

Join in the discussion - add comment below:

Login / Signup to post new comments