openapi: 3.0.3
info:
  title: 'Project 2: Permits — Data Source APIs'
  version: 1.0.0
  description: "## TL;DR\nLive, no-auth public APIs for **Project 2: Permits**. All\
    \ verified 2026-09-02; CORS enabled so **\"Try it out\" works from this page**.\n\
    \n| Need | Endpoint | Auth |\n|---|---|---|\n| Permits — City of LA | `LADBS Permits`\
    \ (Socrata SODA) | none |\n| Permits — San Francisco | `DataSF Building Permits`\
    \ (SODA) | none |\n| Permits — Miami-Dade | `Miami-Dade Building Permits` (ArcGIS\
    \ REST) | none |\n| Closings / sales history | `ATTOM Property API` | API key\
    \ (30-day trial) |\n\n**Not covered by any public API:** Beverly Hills / West\
    \ Hollywood permits, MLS closings (MLS license or ATTOM).\n\n    ### Query cheat-sheet\n\
    \    * **Socrata (SODA)** — `$where`, `$select`, `$order`, `$limit`, `$offset`.\
    \ SoQL syntax, e.g. `$where=date_occ > '2026-08-01'`. Optional `X-App-Token` header\
    \ raises rate limits.\n    * **ArcGIS REST** — `where` (SQL), `outFields`, `resultRecordCount`,\
    \ `resultOffset`, `returnGeometry`, `returnCountOnly`, `f=json`.\n"
tags:
- name: Permits — City of LA (LADBS)
- name: Permits — San Francisco (DataSF)
- name: Permits — Miami-Dade
- name: Property — ATTOM (paid)
  description: Owner name, AVM, sales history. Requires `apikey` header from https://api.developer.attomdata.com/signup.
paths:
  /pi9x-tg5x.json:
    servers:
    - url: https://data.lacity.org/resource
    get:
      tags:
      - Permits — City of LA (LADBS)
      summary: LADBS building permits issued 2020–present
      operationId: ladbsPermits
      parameters:
      - name: $where
        in: query
        schema:
          type: string
          default: zip_code in ('90272','90049','90077','90046') AND issue_date >
            '2026-08-01T00:00:00' AND valuation::number > 100000
      - name: $select
        in: query
        schema:
          type: string
          default: permit_nbr,primary_address,zip_code,apn,permit_type,permit_sub_type,use_desc,issue_date,status_desc,valuation,lat,lon
      - name: $order
        in: query
        schema:
          type: string
          default: issue_date DESC
      - name: $limit
        in: query
        schema:
          type: integer
          default: 25
      responses:
        '200':
          description: Array of permits
          content:
            application/json:
              example:
              - permit_nbr: 22016-90000-38688
                primary_address: 9229 N VALJEAN AVE
                zip_code: '91343'
                apn: '2676018025'
                permit_type: Bldg-Alter/Repair
                permit_sub_type: 1 or 2 Family Dwelling
                use_desc: Dwelling - Single Family
                issue_date: '2022-12-22T00:00:00.000'
                status_desc: Permit Finaled
                valuation: '5000'
  /i98e-djp9.json:
    servers:
    - url: https://data.sfgov.org/resource
    get:
      tags:
      - Permits — San Francisco (DataSF)
      summary: SF DBI building permits
      operationId: sfPermits
      parameters:
      - name: $where
        in: query
        schema:
          type: string
          default: filed_date > '2026-08-01T00:00:00' AND estimated_cost::number > 250000
      - name: $select
        in: query
        schema:
          type: string
          default: permit_number,permit_type_definition,filed_date,issued_date,status,street_number,street_name,street_suffix,zipcode,description,estimated_cost
      - name: $order
        in: query
        schema:
          type: string
          default: filed_date DESC
      - name: $limit
        in: query
        schema:
          type: integer
          default: 25
      responses:
        '200':
          description: Array of permits
          content:
            application/json:
              example:
              - permit_number: '201806293452'
                permit_type_definition: additions alterations or repairs
                filed_date: '2018-06-29T00:00:00.000'
                status: issued
                street_number: '930'
                street_name: Sutter
                street_suffix: St
                zipcode: '94109'
                estimated_cost: '350000'
  /MD_LandInformation/MapServer/1/query:
    servers:
    - url: https://gisweb.miamidade.gov/arcgis/rest/services
    get:
      tags:
      - Permits — Miami-Dade
      summary: Miami-Dade County building permits (last 3 years, weekly refresh)
      operationId: miamiDadePermits
      parameters:
      - name: where
        in: query
        required: true
        schema:
          type: string
          default: 1=1
      - name: outFields
        in: query
        schema:
          type: string
          default: ID,PROCNUM,FOLIO,ADDRESS,UNIT,TYPE,CAT1,DESC1,ISCONDO
      - name: orderByFields
        in: query
        schema:
          type: string
          default: ID DESC
      - name: resultRecordCount
        in: query
        schema:
          type: integer
          default: 10
          maximum: 1000
      - name: resultOffset
        in: query
        schema:
          type: integer
          default: 0
      - name: returnGeometry
        in: query
        schema:
          type: boolean
          default: false
      - name: f
        in: query
        required: true
        schema:
          type: string
          default: json
          enum:
          - json
          - geojson
      responses:
        '200':
          description: ArcGIS feature set
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArcGisFeatureSet'
              example:
                displayFieldName: PROCNUM
                features:
                - attributes:
                    ID: 2023069958
                    PROCNUM: M2023069958
                    FOLIO: '3040100000000'
                    ADDRESS: 1234 NW 12 AVE
                    TYPE: BLDG
                    DESC1: SINGLE FAMILY RESIDENCE
  /propertyapi/v1.0.0/property/detailowner:
    servers:
    - url: https://api.gateway.attomdata.com
    get:
      tags:
      - Property — ATTOM (paid)
      summary: ATTOM — property detail with owner name (requires API key)
      operationId: attomDetailOwner
      description: Returns owner name(s), mailing address, and property characteristics.
        Will return 401 without a valid `apikey`. Pair with `/saleshistory/detail`
        and `/attomavm/detail`.
      security:
      - attomApiKey: []
      parameters:
      - name: address1
        in: query
        required: true
        schema:
          type: string
          default: 1250 Monaco Dr
      - name: address2
        in: query
        required: true
        schema:
          type: string
          default: Pacific Palisades, CA 90272
      - name: accept
        in: header
        schema:
          type: string
          default: application/json
      responses:
        '200':
          description: Property with owner block
          content:
            application/json:
              example:
                status:
                  code: 0
                  msg: SuccessWithResult
                  total: 1
                property:
                - identifier:
                    attomId: 184196315
                    apn: 4407-012-003
                  address:
                    oneLine: 1250 MONACO DR, PACIFIC PALISADES, CA 90272
                  owner:
                    owner1:
                      lastName: DOE
                      firstNameAndMi: JANE
                    mailingAddressOneLine: 1250 MONACO DR, PACIFIC PALISADES, CA 90272
                    corporateIndicator: N
                    absenteeOwnerStatus: O
        '401':
          description: Missing / invalid apikey
components:
  securitySchemes:
    attomApiKey:
      type: apiKey
      in: header
      name: apikey
  schemas:
    LapdOffense:
      type: object
      properties:
        caseno:
          type: string
        date_rptd:
          type: string
          format: date-time
        date_occ:
          type: string
          format: date-time
        area_name:
          type: string
        rpt_dist_no:
          type: string
        nibr_code:
          type: string
        nibr_description:
          type: string
        crime_against:
          type: string
          enum:
          - Property
          - Person
          - Society
        premis_desc:
          type: string
        status_desc:
          type: string
        hndrdth_loc_chk:
          type: string
          description: Hundred-block address
        hndrdth_lat:
          type: string
        hndrdth_lon:
          type: string
    ArcGisFeatureSet:
      type: object
      properties:
        displayFieldName:
          type: string
        fields:
          type: array
          items:
            type: object
        features:
          type: array
          items:
            type: object
            properties:
              attributes:
                type: object
        exceededTransferLimit:
          type: boolean
