Web API Incident Counts

thequbit edited this page Apr 5, 2013 · 1 revision

Incident count API's

The incident count API returns simple JSON objects which can be used with visualization libraries such as [D3] (http://d3js.org/) or PyGal.

Daily Incident Counts

API URL

Parameters

  • type - Type of API call that should be made (here it will be 'dailycounts')
  • date - The date of interest (note: if no date is specified, today's date is used.)

Description

  • This API call returns a count of all incident types for a specific date. An incident name, a count for the number of times that incident was reported that day, as well as a unique letter representing the incident. Note: this letter is calculated at the time of the API call, and is not unique to the incident name that it represents.

Headers in JSON

  • incidentname- The date of the count
  • count - The count of all dog related incidents for the date
  • letter - This is a unique letter that can be used for display, as many of the incident types are rather long

Response Object:

[
	{
		"incidentname":"Accident of motor vehicles involving known injury",
		"count":"16",
		"letter":"A"
	},
	{
		"incidentname":"Accident of motor vehicles involving unknown injury",
		"count":"39",
		"letter":"B"
	},

	... etc.

]

All-Time Summation of Daily Incidents

All-Time Summation

API URL

Description

  • This API call returns a summation of all 911 calls made on in a day. This call will return all days that are loaded into the database, that is, 100% of the days the scrapper has been running.

Headers in JSON

  • date - The date of the count
  • count - The count of all motor vehicle related incidents for the date

Response Object:

[
	{
		"date":"2013-01-10",
		"count":"24"
	},
	{
		"date":"2013-01-11",
		"count":"28"
	},

	... etc.
]

Specific Incident Counts

Barking Dogs

API URL

Description

  • This API call returns a summation of 911 calls for barking dog incidents by day. This call will return all days that are loaded into the database, that is, 100% of the days the scrapper has been running.

Headers in JSON

  • date - The date of the count
  • count - The count of all dog related incidents for the date

Response Object:

[
	{
		"date":"2013-01-10",
		"count":"338"
	},
	{
		"date":"2013-01-11",
		"count":"439"
	},

	... etc.
]

Motor Vehicle Accidents

API URL

Description

  • This API call returns a summation of 911 calls for motor vehicle accidents related incidents by day. This call will return all days that are loaded into the database, that is, 100% of the days the scrapper has been running.

Headers in JSON

  • date - The date of the count
  • count - The count of all motor vehicle related incidents for the date

Response Object:

[
	{
		"date":"2013-01-10",
		"count":"118"
	},
	{
		"date":"2013-01-11",
		"count":"167"
	},

	... etc.
]