Skip to content
This repository was archived by the owner on Jan 18, 2023. It is now read-only.

Location Detail

Kelvin edited this page Oct 26, 2020 · 25 revisions

Location Detail Method

location.get_detail(
    search_items, 
    location_type, 
    csv=False`, 
    output_dir='cwd', 
    extra_param=None`
)

Returns an array of Location Detail product for the given ID and location_type. Optionally creates a csv file. Arguments provided to extra_param will be appended to the end of the endpoint call.

(More information on the Location product can be found on the Location Detail Page on the First Street Foundation API Data Dictionary)

Arguments:

  • search_items: list/file of SearchItems, parcels to retrieve location details for.
  • location_type: string, one of {property, neighborhood, city, zcta, tract, county, cd, state}, for the search item type.
  • csv: bool, whether to create a CSV for the retrieved data.
  • output_dir: string, location to output the created CSV (if csv is True).
  • extra_param: string, extra parameters to be sent with the request.

Example (Command Line):

python -m firststreet -p location.get_detail

Example (Python File):

# Contents of sample.py
# Create a `FirstStreet` object.  
import firststreet
fs = firststreet.FirstStreet("api-key")

# Call location.get_detail on a list with 3 property FSIDs
location_detail = fs.location.get_detail([511447411, 511447412, 511447413], "property")

# Call location.get_detail on a list with 1 state FSID
location_detail = fs.location.get_detail([19], "state")

# Call location.get_detail on a file of SearchItems
location_detail = fs.location.get_detail("sample.txt", "property", csv=True)

Clone this wiki locally