Getting XCSRF TOKEN with python

Yes I did some researched and none of them work.

How do I get my XCSRF Token using the Python Requests Library? I need it to avoid getting Status Code 403 since I am trying to make a Group Shout BOT.

When getting a 403 error due to an invalid xcsrf token (or none provided), you should be able to find a new one in the response headers if you look closely enough.

Yeah I did

print(r.header)

And it showed me a list so I looked for the xcsrf but I couldnt find it.

you need to send your cookie in header with v2/logout api to get your xcsrf token from response header

image

logout_data = {
    'Accept':'application/json',
    'Cookie': 'my.ROBLOSECURITY'
}

h = requests.post("https://auth.roblox.com/v2/logout",headers=logout_data)
print(h.headers)

I still cant find xcsrf

you need to send your cookie like this


add .ROBLOSECURITY= before your actual cookie

1 Like

Still no XCSRF, can you send your own output? Blur the XCSRF token though.

Try formatting your request like this

h = requests.post("https://auth.roblox.com/v2/logout", headers=logout_data, cookies={
    '.ROBLOSECURITY': '[REDACTED]'
})
print(h.headers)

green one is the token

Yup, mine only shows -1 while the rest doesnt… NVM it works