Closed fleetingbytes closed 1 month ago
Hi @fleetingbytes
It seems you're bumping into whatever anti-bot/DDOS protection is running in front of /api
. I'm not privy to the details, but from testing it seems that if you use a User-Agent other than python's default it should be good to go. Tested it with a browser, insomnia, and curl from cli. As soon as I tell curl to send the header I get the same response as you.
$ curl "https://regex101.com/api/regex/AaKDTO/1"
{"error":"Regex does not exist","errorId":"30eeb9bb-ecb5-4a54-a840-c6711b8bb124"}
$ curl "https://regex101.com/api/regex/AaKDTO/1" -H "User-Agent: python-requests2.31.0"
curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
@working-name is right
Question
I am trying to use the API with Python's requests library. Following the API documentation how to retrieve an entry I wrote this minimal script:
I expect to get a 404 response with the following content:
{"error":"Regex does not exist","errorId":"b20d027a-fb34-4e34-bb4e-c2e60f568b98"}
.However, when I run it, I get this:
Is anything wrong with the API or the API documentation?