0
votes

I want to use file_get_contents to get content from this Google CSE API https://www.googleapis.com/customsearch/v1?key={My-KEY-HERE}&cx=015435574869060730302:bycrgaosjuu&q=intitle:funny but it return me failed to open stream: No error ,I tried to change https:// with http:// but it return me failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden

How do I get Google CSE API contents With file_get_contents?

1
Try requesting a file from another foreign server. Some web hosts have blocked that feature so it might be not possible on your server.ByteHamster
I tried now from another web-host but the problem is the sameMaria Bernal

1 Answers

0
votes

I don't think the problem in file_get_contents function, you are just not authorised, double check the keys and check the google console for IP restriction on API, and check if application is ON