google-maps-api-3openrefinegrel

How do i tell Openrefine to fetch some data trough the google and facebook API (Grel)


I have a list of around 500 foundations and companies and i need to fetch more data like address, description, lat long, email or phone number, from the google and FB APIs I have found something more or less like this, but it won't work in OpenRefine, i need some help please.

I think it is possible to do beacause there is an addon called spotlight for spreadsheets that is able to fetch Google URLs and Lat Long https://www.youtube.com/watch?v=Vj1v3QfyrgA&feature=youtu.be

https://maps.googleapis.com/maps/api/place/findplacefromtext/output?parameters/json?input=value&inputtype=textquery&fields=photos,formatted_address,name,rating,email,geometry&key=YOURKEY

I have created the FB and Google places and google staic map API already. I have tried different queries, but it won't work unless it is in GREL

value.parseJson().geonames[0].lng
value.parseJson().geonames[0].geonameId
value.parseJson().geonames[0].lat

Solution

  • From the error "This API project is not authorized to use this API" the first thing to check is that you have enabled the Places and/or Geocoding API in the Google Developer console, and you have setup an API Key and that it is showing as a credential for the Places API and/or the Geocoding API

    Next step, take OpenRefine out of the equation and check you can get a simple API call working in your browser - using one of the Google Places API examples:

    https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=Museum%20of%20Contemporary%20Art%20Australia&inputtype=textquery&fields=photos,formatted_address,name,rating,opening_hours,geometry&key=<INSERT YOUR API KEY HERE>
    

    If that gives you the same error, you know the issue is not with OpenRefine.

    If you are still having problems in OpenRefine make sure you are creating URLs in OpenRefine that are valid for the appropriate Google API based on the documentation for that API and that you are using the correct API key.