Granicus Search API - Examples

cURL

Fetching up to 500 archives with HLS streams on sanfrancisco.granicus.com, sorted by date, faceted by year:

$ curl -XGET 'http://search.granicus.com/api/sanfrancisco.granicus.com/_search' -d '{
	"sort":[{"datetime":"desc"}],
	"query": {
		"filtered":{
			"query" : { "match_all":{} },
			"filter":{"not":{"missing":{"field":"hls"}}}
		}
	},
	"filter": {
		"numeric_range" : {
			"datetime" : {
				"lt" : "2012-01-01",
				"gte" : "2011-01-01"
			}
		}
	},
	"facets" : {
		"years" : {
			"date_histogram" : {
				"field" : "datetime",
				"interval" : "year"
			}
		}
	},
	"size":500
}'