This page provides information on National Crime Victimization Survey (NCVS) datasets that are available via an Application Programming Interface (API) called Socrata Open Data API (SODA API). The API follows the REST (REpresentational State Transfer) design pattern to format requests and provide researchers and developers with end-points in multiple formats along with related codebooks, methodology, and metadata. More information about SODA API can be found here.
National Crime Victimization Survey (NCVS)
The National Crime Victimization Survey (NCVS) collects information on nonfatal personal crimes (i.e., rape or sexual assault, robbery, aggravated and simple assault, and personal larceny) and household property crimes (i.e., burglary/trespassing, motor vehicle theft, and other types of theft) both reported and not reported to the police. Survey respondents provide information about themselves (e.g., age, sex, race and Hispanic origin, marital status, education level, and income) and whether they experienced a victimization.
BJS created NCVS Select datasets, which are available through API and include commonly used variables for analysis. Complete versions of annual and concatenated NCVS data can be found at the National Archive of Criminal Justice Data.
NCVS Select Person level data
NCVS Select – Personal Population contains demographic information of respondents. All respondents, regardless of whether they reported a personal crime victimization, are included in this file.
NCVS Select – Personal Victimization contains personal crime victimizations. Personal crimes include rape and sexual assault, robbery, aggravated and simple assault, and personal theft/larceny (purse-snatching/pocket picking). Persons that did not report a personal crime victimization are not included on this file. Victimizations that took place outside of the United States are excluded from this file.
NCVS Select Person Level Codebook: provides description of person-level datasets.
NCVS Select Household level data
NCVS Select – Household Population contains demographic information of participating households. All respondents, regardless of whether they reported a household property crime victimization, are included in this file.
NCVS Select – Household Property Victimization contains property crime victimizations. Property crimes include burglary, theft, motor vehicle theft, and vandalism. Households that did not report a property crime victimization are not included on this file. Victimizations that took place outside of the United States are excluded from this file.
NCVS Select Household Level Codebook: provides description of household-level datasets.
The National Crime Victimization Survey (NCVS) SODA API is a RESTful web service that provides data on violent and property victimization by select victim, household, and incident characteristics.
All calls to the NCVS API are formed by adding the resource path (resource identifier) to the following base URL: https://data.ojp.usdoj.gov/resource/.
Note!
By default the NCVS API returns a maximum of 1,000 records. All NCVS datasets include more than 1,000 records for any given year. To receive a complete set of records from an NCVS API query, add a "Limit" parameter to the API call to increase the maximum number of records the query's allowed to return. See Example queries, and Record counts under NCVS API endpoints Queries below.
The NCVS API can return data to users in multiple formats including JSON, XML and CSV formats. To specify a desired format, append a format string (.json, for example) to the end of the URL; JSON is the default format:
- https://data.ojp.usdoj.gov/resource/{dataset identifier}.json
- https://data.ojp.usdoj.gov/resource/{dataset identifier}.csv
Users may view each dataset to learn more about its Socrata built-in documentation on metadata, fields, API endpoint metadata, data download and OData endpoint.
NCVS API endpoints
- NCVS Select Personal Victimization
Endpoint: https://data.ojp.usdoj.gov/resource/gcuy-rt5g
Dataset page: NCVS Select Personal Victimization dataset page
Record counts: Number of NCVS Personal Victimization cases - NCVS Select Personal Population
Endpoint: https://data.ojp.usdoj.gov/resource/r4j4-fdwx
Dataset page: NCVS Select Personal Population dataset page
Record counts: Number of NCVS Personal Population cases - NCVS Select Household Victimization
Endpoint: https://data.ojp.usdoj.gov/resource/gkck-euys
Dataset page: NCVS Select Household Victimization dataset page
Record counts: Number of NCVS Household Victimization cases - NCVS Select Household Population
Endpoint: https://data.ojp.usdoj.gov/resource/ya4e-n9zp
Dataset page: NCVS Select Household Population dataset page
Record counts: Number of NCVS Household Population cases
Example queries
Users may request either personal or household property victimization and population data for any years included in the datasets.
You can query and filter datasets using field names as parameters and the content you want to filter for as their values. Multiple filters may be combined using a boolean AND
. More information about SODA API can be found here.
- To query the personal victimization data for all available years in CSV format: https://data.ojp.usdoj.gov/resource/gcuy-rt5g.csv?$limit=200000
- To query the personal population data for 2010 and 2020 in JSON format: https://data.ojp.usdoj.gov/resource/r4j4-fdwx.json?$query=select * where year in ("2010", "2020") limit 500000
- To query the household property victimization data for 2020 in CSV format: https://data.ojp.usdoj.gov/resource/gkck-euys.csv?year=2020&$limit=12000