How to find if a stream is live using Python?

No, user_id is the users ID on Twitch, not their username. If you look at the example response in the docs there are 2 fields "user_id": "23161357", "user_name": "LIRIK",, The first is that users ID, the second is their username (which would be the user_login parameter when making a request).

As for the reason you’re getting a 404 error, that’s because your sending a POST request, where as this endpoint uses a GET request as specified in the docs. You would also need to change ?user_id=scarra to ?user_login=scarra as you’re trying to make a request by username, rather than ID.