Google Places API photo error: 403 Forbidden
Asked Answered
C

2

7

I'm trying to access Places photos using the photoreference.

This works:

https://maps.googleapis.com/maps/api/place/photo?maxwidth=800&photoreference=CnRsAAAAGrxlcgShBlZZJgAFxr19eT3fQKxeDTpN4HtyCIsUpOHjUPqB_tm_J_Rf9sbwyWU1j4_SSRWyFiIT0TYGDSn6mAwAQ6ep-9Rok0kAEf6LewL8CRYbaEVoEsfrZXs_BIwUcqNs5p1TQv-EMt-PO8RloBIQHF40AvYJVknRixv4uFYVVRoUGKN_fqy7qynsrclqkBbAdaIpi58&key=MY_KEY

But this one doesn't:

https://maps.googleapis.com/maps/api/place/photo?maxwidth=800&photoreference=CnRnAAAADBlPZditZugHCXmMtb0_qQqwyh3rJ0ByTxnI_MRXXEB7Cj_I1QgTKi7XMUAXbD3YMEH8yPdfIH-u-uoM0ZnMsLY6l0eF0Ip9JTkqkw5tgE_eD6RUhgOztHJ312JRWIFkJq2faixmtTM4DILp4WsWaRIQQy53oVWAfP68T60TsYQSNxoUZDjyv0kLie1ZGNzDrF2YgqqktWo&key=MY_KEY

Both photoreferences are valid. I can access about 50% of the pictures, the other 50% gives me a 403 error. I have a paid license key, and am not over the limit (anyway it's not that the first 50% works and then it gives 403, but quite random, some work, some don't).

Any ideas?

Concede answered 18/2, 2015 at 13:41 Comment(6)
Did you figure this out?Elodiaelodie
No, I raised a ticket with Google, will give an update if they come back to meConcede
The answer from google: After reviewing the information you provided in relation to forbidden 403 statuses for photo references in Places API, we believe that you may be affected by an internal issue on our end (#19376901). I've added your Places API project number and information related to this case to this internal issue.Concede
I'll file an issue as well. Thanks for the info!Elodiaelodie
I‘m still seeing this behavior in 2020! Did Google ever try to fix it?Minoan
@Concede - did you find the solution for the same, we are finding this behaviour erraticallyWilli
J
1

The photo seems to have been removed (or made private) by its owner.

Your 2nd Places Photo request (link) returns a redirect:

HTTP/1.1 302 Found Location: https://lh5.googleusercontent.com/-gMRov-DClsg/UkYcLUa5mtI/AAAAAAAAJiI/48Zbe7GvS9I/s1600-w800/photo.jpg

The response for that photo.jpg URL is simply HTTP 404 Not Found.

Janniejanos answered 4/11, 2016 at 10:4 Comment(1)
Any chance you can check out this one too? It also gives me a 403 even though I'm nowhere need quota. maps.googleapis.com/maps/api/place/…Aleishaalejandra
P
0

Try to get the image with php function: file_get_contents

Prentice answered 26/10, 2016 at 16:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.