-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Response 403 - Can't access member images #310
Comments
Hello. Sure, we will take a look at this. |
Funny, just yesterday I was attempting to do the same. Simply providing a User Agent and |
@Gmanicus This didn't work for me.
What did you use for those headers? |
🤔 Odd.
Appears to be the magic combination. |
@Gmanicus Hm, I tried this on my linux desktop and my mac and still got a 403 response. I used different networks too. Can you share more of your code and perhaps the versions of Python and Requests you are using? |
@asebold Ah, I would be happy to, but unfortunately it looks like this is just inconsistency from Cloudflare. I'm starting to see mostly 403 Forbidden as well now. Odd thing is, making the request through Postman never sees a 403 response. Sorry about that. Edit: Got it working again by making requests over HTTP/2. Looks like you can do that in Python using the HTTPX package. |
Hello - we are actively looking into this. Stay tuned for updates. Thanks! |
I'm still getting the same 403 response. Are there certain headers or parameters I should include in the request? |
Looks like the same behavior from my end as well (In a script. Notably, requests via Postman work fine).
|
I'm unable to access member images using the Python Requests library.
Description of Problem
member
endpoint, a url to an image of the member is sometimes provided via theimageUrl
property.Example:
Url:
https://api.congress.gov/v3/member/m001226/?api_key=DEMO_KEY&format=json
Response:
https://www.congress.gov/img/member/m001226_200.jpg
) in my browser, I see the image of the member. When I try to obtain the image via the Python Requests library, I get a 403 response that appears to be generated by Cloudflare.Example:
Response:
Questions
https://api.congress.gov
as opposed tohttps://congress.gov
? This way api keys and rate limiting would still be enforced, perhaps relieving the need for the Cloudflare challenge.The text was updated successfully, but these errors were encountered: