Get an URL date using inurl on Google Custom Search API - google-api

How can I know when an URL was added into Google index using the GCS (Google Custom Search API)? I know I can get it throw the "inurl" parameter, but only on regular Google Search, like example below:
https://www.google.com.br/search?q=inurl%3Amoz.com%2Fblog%2F25-killer-combos-for-googles-site-operator
If someone have some code in java, I'll be glad. :)

Sort by date ?
https://developers.google.com/custom-search/docs/structured_search?hl=ja#sort_by_attribute
makes dates show, where available ...
Worth a try - I'm no expert !

Related

Google API for the Search Result Events

I'm looking for the correct API for the events that show up in a regular Google Search, the ones that are structured (with name, datetime, location)
Any help or guidance is appreciated
I have tried the Custom Search with no luck, and also the Calendar API (which seems to require a calendar ID, more so for personal calendars or targeted public ones)
We've actually just made an API to scrape the Google event results. You can query it directly like this:
https://serpapi.com/search.json?engine=google_events&q=Events+in+Austin
Or if you are using Ruby, you can do something like this:
require 'google_search_results'
params = {
engine: "google_events",
q: "Events in Austin",
}
client = GoogleSearchResults.new(params)
events_results = client.get_hash[:events_results]
Some documentation: https://serpapi.com/google-events-api
I had a quick look - while I didn't find a fully programatic API yet, here are two things that can get you started on more:
How to search the events page directly: use the following URL schema: https://www.google.com/search?q=cool+conferences&oq=cool+conferences&ibp=htl;events&rciv=evn - replacing "cool+conferences" with any string you like - this can let you create dynamic URLs for event searches.
How to access event metadata for a given page - google is pushing a standard to structure data on webpages to support "smart" searches such as for events. They are using a data structure called JSON-ld. More details. If you want to read such metadata from a webpage, here is one scraper I have found that does that - extruct (though I didn't get a change to test it yet).
Hope this helps :)

Filter results from YouTube data API based on date

I am trying to filter data from YouTube data API (using commentThreads).
Goal here is to get all the comments published for the channel after 2018-03-25. I have tried different date formats and it looks like the filter is not working as I get all the results back.
Any ideas?
https://www.googleapis.com/youtube/v3/commentThreads?part=snippet&allThreadsRelatedToChannelId=UCU34OIeAyiD4BaDwihx5QpQ&key=xxxx&maxResults=100&publishedAfter=2018-03-25T13:15:30Z
I've never used the Youtube google api, but assuming that this is the API reference: https://developers.google.com/youtube/v3/docs/commentThreads/list
It doesn't mention the publishedAfter-option, which leads me to believe that it doesn't exist?
This probably means that you'll need to use the order option along with maxResults to achieve your goal.

Google search appliance GSA URL regarding to suggestion

I'm facing some problem regarding to query hit for generating suggestion.
Please take a look below URL structure and suggest the appropriate URL modification.
http://{host-name}/search?start=0&num=1000&site=bhtest&output=xml&client=pp_frontend&filter=0&getfields=*&q=sken+inmeta:contenttype~Product%20OR%20inmeta:contenttype~Content
In the above query, search term is "sken", GSA suggestion tag should appear and provide suggestion for "skin" but it is not happening
When I change the query to:
http://{host-name}/search?start=0&num=1000&site=bhtest&output=xml&client=pp_frontend&filter=0&getfields=*&q=sken
Then it provides the suggestions.
Can you please help to find out the problem in first one URL.
Suggestions are not returned when you add metadata filters. See the search protocol reference found here
The way to work around this is to issue two queries, one with your filter and one without.
It is related to language parameter in my oppinion. Try use &lr and &hl parameters. GSA suggest by this parameters.

Sorting places by distance - Android

I am using Google places API for writing my android app. I want to get a list of places close to current location of the device based on prominence(i.e I do not want to pass "keyword" or "type" or "name" parameter in my URL). Is there a way to do this?
According to the following link, you have to pass keyword, name or type parameter in the URL.
https://developers.google.com/places/training/additional-places-features
I searched google and quite many threads on stackoverflow, but could not find much useful help in using rankby=distance parameter. I would appreciate it if you could share your experiences on sorting places by distance using google places API.
Thank you for your help.
NOTE:
The following URL fails:
https://maps.googleapis.com/maps/api/place/search/json?location=37.787930,-122.4074990&rankby=distance&sensor=false&key=
Keyword, Type and Name are all optional parameters. You only need to pass your API Key, Location and sensor. See the following link for details:
https://developers.google.com/places/documentation/search

Search - How to implement the Google website search like the one used here

I would like to implement a search function for my website as the functions listed here
https://stackoverflow.com/search
What should I do in order to do this?
Based on my understanding, two methods can be used to provide search function for my website.
1> MySQL full text search
2> Use search lucene package.
My guess is that the search function here
https://stackoverflow.com/search is neither of them. So what is the method that has been used to provide such a search on the website?
Thank you
Just look at the url:
http://www.google.com/search?sitesearch=stackoverflow.com%2Fquestions&q=texthere
It would seem that a MySQL approach would work if your site is entirely database-driven. Otherwise, you need something that spiders, such as Zoom by WrenSoft. http://www.wrensoft.com/

Resources