Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use additional search parameters? #47

Open
toponline opened this issue Mar 1, 2020 · 1 comment
Open

How to use additional search parameters? #47

toponline opened this issue Mar 1, 2020 · 1 comment

Comments

@toponline
Copy link

Hello,

Is this possible to use additional search parameters, for example &tbs=qdr:d?

@PatNeedham
Copy link
Owner

Hi @toponline , currently it is not possible to use additional search parameters, although I think that can change relatively easily. Right now there is a getDefaultRequestOptions function that returns an object with the fixed query string parameters of q, num, and start. It's feasible to allow for custom parameters that would be added here. For invoking google-it via a NodeJS program it would be straightforward enough to add a params option:

googleIt({
  query: 'the irrelevant elegant elephant'
  params: {
    tbs: 'qdr:d'
  }
}

And if invoking via the command line, that might be trickier. I'm not sure how to pass an object as a command line argument, but maybe we can require it to be a string in JSON format, so that JSON.parse can be attempted to convert it to an object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants