Group Abstract Group Abstract

Message Boards Message Boards

Google Searches

Posted 11 years ago

In case anyone has had the chance to work with this before:

How to restrict my query to a specific data range?

e.g.

Import["https://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=NASA", "JSON"]
POSTED BY: Sandu Ursu
15 Replies
POSTED BY: Damanjit Singh
POSTED BY: Abigail Nussey

Yeah, I've also noticed that. My guess is that it's because, when you Google something directly from your browser, Google is using your personal preferences (specially if you are logged into your Google account) and user metadata. However, if you do it via the API, the custom search engine you created is what's controlling the search.

If you don't want those Google+ results to appear when using GoogleCustomSearch from the Wolfram Language, you can do:

gcs = ServiceConnect["GoogleCustomSearch"]
gcs["Search",{"Query"-> "Your name","Site"-> Except["plus.google.com"]}]

Feel free to ask anything if you still have issues with this or other services. Note that for web search, BingSeach is also available

Posted 10 years ago
POSTED BY: Sandu Ursu

To get the API Key you first have to go to https://console.developers.google.com and create a project if you don't have one yet. Once you have the project (asuming you are using the new console interface), click the Credentials menu at the left. There you'll see all your credentials. If don't have one, click the Add credentials and, for GoogleCustomSearch, you need the API key Browser key type.

For the Custom search engine ID, you have to go to https://cse.google.com/all and add a search engine. Once you create it, just click on that and you'll get a screen with a lot of options. There's a button there that says Search engine ID. Click it and you'll get the ID you need.

Regarding your original question, GoogleCustomSearch API supports the dateRestrict parameter, however, the WL connection does not support that parameter yet (but we have plans to add more support to this service).

Please let me know if you have questions about this functionality.

GoogleCustomSearch was released with Mathematica 10.2 so you should be good to use it.

Posted 11 years ago

I have created a Google Custom search engine and from the site URL Basics tab can get the "Custom search engine ID" by clicking on its tab OK but cannot see how to get the "API key".

Help appreciated.

POSTED BY: Syd Geraghty
Posted 11 years ago

Thanks, but the manual doesn't really say how to get the credentials.

enter image description here

POSTED BY: Sandu Ursu
POSTED BY: Sander Huisman
Posted 11 years ago

10.3.0 for Microsoft Windows (64-bit) (October 9, 2015)

POSTED BY: Sandu Ursu
POSTED BY: Sander Huisman
Posted 11 years ago

It looks nice, but I cannot replicate the result.

POSTED BY: Sandu Ursu

BTW - have you seen THIS?

results = ServiceExecute["GoogleCustomSearch", "Search", 
{"Query" -> "Orion spacecraft", "FileType" -> Except["png"], "MaxItems" -> 5, "SearchType" -> "Image"}]; 
results[All, {1, 2, 6, 7}]

enter image description here

POSTED BY: Sam Carrettie
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard