HttpError 403 client error: forbidden for url when making requests to bloxflip

Here’s my code

import json
import requests
from dhooks import Webhook, Embed
from time import sleep

headers = {
    "User-Agent": (
        "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like"
        " Gecko) Chrome/114.0.0.0 Safari/537.36"
    )
}
url = "htps://api.bloxflip.com/chat/history"
webhook = Webhook(
    "htps://discord.com/api/webhooks/1134295221706969147/<censored>"
)


while True:
    rain_active = False
    if rain_active == False:
        r = requests.get(url, headers=headers)
        r.raise_for_status()
        r = r.json()["rain"]
        if r["active"] == True:
            prize = r["prize"]
            em = Embed(color=0x0025FF, timestamp="now")
            em.add_field(
                name="Rain!",
                value=f"Active Rain ${prize}[join rain](htps://bloxflip.com)",
            )
            em.set_timestamp
            webhook.send("@everyone rain notif")
            webhook.send(embed=em)
            rain_active = False
        else:
            rain_active = False
time.sleep(30)

I keep getting
HttpError 403 client error forbidden for url

Hey @GoatGuy1, welcome to the community!

First of all, you misspelled https twice:

Second of all, I highly recommend you don’t use bloxflip, as it completely goes against the Roblox ToS. It has gambling and is just a big scam.

2 Likes