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?

Geza
  • 464
  • 6
  • 16
  • Did you figure this out? – Levi Botelho Feb 25 '15 at 20:55
  • No, I raised a ticket with Google, will give an update if they come back to me – Geza Feb 26 '15 at 21:57
  • 1
    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. – Geza Feb 27 '15 at 11:30
  • I'll file an issue as well. Thanks for the info! – Levi Botelho Feb 28 '15 at 09:27
  • 1
    I‘m still seeing this behavior in 2020! Did Google ever try to fix it? – morgler Aug 01 '20 at 14:18
  • @Geza - did you find the solution for the same, we are finding this behaviour erratically – Prateek Sep 27 '22 at 15:16

2 Answers2

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.

miguev
  • 4,481
  • 21
  • 41
  • Any chance you can check out this one too? It also gives me a 403 even though I'm nowhere need quota. https://maps.googleapis.com/maps/api/place/photo?maxwidth=1600&photoreference=CmRaAAAAsYRvv05hLbzBFe5laroaIqLfUamcaloSD57gCVT3qz8HvFIyh7VLZuMPBW2eQgYo8QNA86GzFdBaR9mkgBoI176KKUlt1QFEzu-ToES5QhpEMj8cstq14Z9y7C5Rz2p2EhBFsgjDWkum1N1Rd3JqNrYqGhSrZoxamt0MKka5XU9z-Oht_f3wZA&key=MY_KEY – Raymond Camden Nov 26 '17 at 01:43
0

Try to get the image with php function: file_get_contents

TomoMiha
  • 1,218
  • 1
  • 14
  • 12