x-fran / g-trends

Google Trends API for PHP
https://tarlabs.es
MIT License
113 stars 47 forks source link

Add option to disable the time parsing in interest by subregion #23

Closed lukasleitsch closed 5 years ago

lukasleitsch commented 5 years ago

The API-Endpoint also accept a time range in this format 2019-10-01 2019-10-31. This format is with the current time parsing not possible.

To allow the time range I added a new parameter to disable the time string parsing.

The google trends api request has the following data for req:

req: {"geo":{"country":"DE"},"comparisonItem":[{"time":"2019-10-01 2019-10-31","complexKeywordsRestriction":{"keyword":[{"type":"BROAD","value":"Developer"}]}}],"resolution":"REGION","locale":"de","requestOptions":{"property":"","backend":"IZG","category":0}}

The PR contains the change from #22 because this function needs this change too.