Structures Documentation
    • Dark
      Light
    • PDF

    Structures Documentation

    • Dark
      Light
    • PDF

    Article summary

    Purpose

    The LightBox Structure API provides access to the LightBox National Structure database. This key dataset is a foundational layer  in the LightBox SmartFabric™ data product. 

    OAS 3.1 Specification

    Features

    • Return structures that intersect a geometry.
    • Return all structures that are related to a parcel boundary.
    • Add structure tile layer to your favorite map control. 
    • Return the structure based on a LightBox ID or a Building UBID.
    • The ability to style parcel boundaries, color, fill, weight, and opacity. This allows you to apply your brand to the display of parcel boundaries within a mapping experience.

    Requirements

    The LightBox APIs are hosted in the cloud and therefore have no platform requirements. Application requirements include:
    • A network connection to the LightBox API server
    • Ability to parse JavaScript Object Notation (JSON) API responses
    • Secure HTTPS connection
    • LightBox authentication key
    • LightBox authentication key

    Connecting your account

    When your LightBox user account is created, a unique API key is also generated. The API key should be kept secret at all times and can only be used for API requests. The key is required in all API calls.

    To retrieve your unique API key:

    • Log in to the LightBox Developer Portal 
    • Select Apps from the menu bar
    • In your approved App, note your API key (under Consumer Key)

    Performing API requests

    All API requests must be made over secure HTTPS connections. Requests made over HTTP will fail.

    The base URL of the API server that all API requests will be made to is: https://api.lightboxre.com/ followed by a version number https://api.lightboxre.com/v1

    Authentication

    LightBox APIs uses a token-based authentication. All requests to the LightBox APIs must be authenticated. The token to be passed via an HTTP header with key 'x-api-key' and value <Your authentication token>

    Pass your unique API key in the authorization header of every LightBox API call.  LightBox uses this information to authenticate your identify and determine whether you have sufficient permissions to complete the operation. curl -X GET -H ‘x-api-key: (api_key)’  https://api.lightboxre.com/

    API Requests

    Query by Geometry

    Query for structure records based on a geometry represented as a well-known text (WKT) string.

    • POINT(-122.40317865990883 45.585729937697515)
    • LINESTRING (-122.40581795357949 45.58497908445598,-122.40325376176125 45.58627054581282)
    • POLYGON ((-122.4032877944377 45.58629457984625,-122.40264406427413 45.585697658341736,-122.40184476598769 45.58610686936547,-122.40244558080703 45.586688769812724,-122.4032877944377 45.58629457984625))

    GET /structures/{countryCode}/geometry

    Pro Tip:
    This endpoint is best used when you have an existing latitude and longitude from a third-party geocoder, or when you are using the value of a map click/identify from a standard map control.

    Example requests

    curl -X GET -H ‘x-api-key: (api_key)’ https://api.lightboxre.com/v1/structures/us/geometry?wkt=POINT%28-117.852723%2033.63799%29&bufferDistance=50&bufferUnit=m

    https://api.lightboxre.com/v1/structures/us/geometry?wkt=POINT%28-117.852723%2033.63799%29&bufferDistance=50&bufferUnit=m

    Parameters

    ParameterTypeDescriptionUsage
    countryCodepathISO 3166 alpha-2 country code (e.g., 'US' for the United States).required
    wktqueryThe geometry of the location is expressed in WKT format.required
    bufferDistancequeryBuffer distance expressed in 'bufferUnits'.optional
    bufferUnitqueryThe unit type to apply to the buffer (e.g., m, km, ft, mi)optional
    limitqueryLimit the number of records returned. Used in pagination along with offset to page through a large result set.optional
    offsetquery
    Offset from the first record (0). Used in pagination along with limit to page through a large result set.
    optional

    Response

    Media type: application/json

    Query By Address

    Query structures by address.

    GET /structures/address

    Pro Tip:
    You can use this endpoint as a one request vs a double request, first to the Geocoder then to Structures, based on the LightBox Structure ID. Note: If the address entered is not related to a structure, you will receive a 404 Not Found HTTP Response

    Example Requests

    curl -X GET -H ‘x-api-key: (api_key)’ https://api.lightboxre.com/v1/structures/address?text=5201%20California%20Ave%2C%20Irvine%20CA

    https://api.lightboxre.com/v1/structures/address?text=5201%20California%20Ave%2C%20Irvine%20CA

    Parameters

    ParameterTypeDescriptionUsage
    textqueryComplete address string.required

    Response

    Media type: application/json

    Query by LightBox ID

    Query structures using the LightBox Parcel 'ID.'

    GET /structures/{countryCode}/{id}

    Pro Tip:
    • A lot of our endpoints end with a single path parameter of ID. When the LightBox ID is supported then it is that ID, but for some resources the ID can be a FIPS code as it is for county, or a state abbreviation, as it is with state. 
    • LightBox IDs are also returned from many resources. For example, Geocoding will return the LightBox ID for Parcel, Structure and Assessment. 

    Example Requests

    curl -X GET -H ‘x-api-key: (api_key)’ https://api.lightboxre.com/v1/structures/us/0501C58EX3CFSULTYW1HR0

    https://api.lightboxre.com/v1/structures/us/0501C58EX3CFSULTYW1HR0

    Parameters

    ParameterTypeDescriptionUsage
    idpathStructure LightBox ID. required
    countryCodepathISO 3166 alpha-2 country code (e.g., 'US' for the United States).required

    Response

    Media type: application/json

    Query by Universal Building ID (UBID)

    Query structures using the Universal Building 'ID.'

    GET /structures/{countryCode}/ubid/{UBID}

    Example Requests

    curl -X GET -H ‘x-api-key: (api_key)’ https://api.lightboxre.com/v1/structures/us/ubid/8554J4QX+7F6-13-13-12-12

    https://api.lightboxre.com/v1/structures/us/ubid/8554J4QX+7F6-13-13-12-12

    Parameters

    ParameterTypeDescriptionUsage
    ubidpathUniversal Building ID.required
    countryCodepathISO 3166 alpha-2 country code (e.g., 'US' for the United States).required

    Response

    Media type: application/json

    Query for all structures that are on a parcel

    Query structures that are on a parcel oe parcels using the LightBox Parcel 'ID.'

    GET /structures/_on/parcel/{countryCode}/{id}

    Pro Tip:
    • Most LightBox API endpoints end with a single path parameter of ID. When the LightBox ID is supported then it is that ID, but for some resources the ID could be a FIPS code as it is for county, or a state abbreviation, as it is with state. 
    • LightBox IDs are also returned from many resources. Geocoding is a great example which will return the LightBox ID for Parcel, Structure and Assessment. 

    Example Requests

    curl -X GET -H ‘x-api-key: (api_key)’ https://api.lightboxre.com/v1/structures/_on/parcel/us/0201MABNPDBU5D2EGP08YA

    https://api.lightboxre.com/v1/structures/_on/parcel/us/0201MABNPDBU5D2EGP08YA

    Parameters

    ParameterTypeDescriptionUsage
    idpathParcel LightBox ID. required
    countryCodepathISO 3166 alpha-2 country code (e.g., 'US' for the United States).required

    Response

    Media type: application/json

    Structures by LightBox Assessment ID

    Return structures that contain the assessment identified by the LightBox Assessment 'ID.'

    GET /structures/_on/assessment/us/{id}

    Example Requests

    curl -X GET -H ‘x-api-key: (api_key)’ https://api.lightboxre.com/v1/structures/_on/assessment/us/030022BT8WGISNVQJIEW54

    https://api.lightboxre.com/v1/structures/_on/assessment/us/030022BT8WGISNVQJIEW54

    ParameterTypeDescriptionUsage
    idpathAn Assessment LightBox ID required

    Response

    Media type: application/json


    Structures by LightBox Address ID

    Return structures that contain the assessment identified by the LightBox Address 'ID.'

    GET /structures/_on/address/us/{id}

    Example Requests

    curl -X GET -H ‘x-api-key: (api_key)’ https://api.lightboxre.com/v1/structures/_on/address/us/0606ZGPRLD5KGWFYRD7QH9

    https://api.lightboxre.com/v1/structures/_on/address/us/0606ZGPRLD5KGWFYRD7QH9

    ParameterTypeDescriptionUsage
    idpathAn Address LightBox ID required

    Response

    Media type: application/json

    Structure by LightBox LocationInfo ID

    Return structures that contain the LocationInfo object identified by the LightBox LocationInfo 'ID.'

    GET /structures/_on/locationinfo/us/{id}

    Example Requests

    curl -X GET -H ‘x-api-key: (api_key)’ https://api.lightboxre.com/v1/structures/_on/locationinfo/us/07040CK7XS88KIGIJILYW4

    https://api.lightboxre.com/v1/structures/_on/locationinfo/us/07040CK7XS88KIGIJILYW4

    ParameterTypeDescriptionUsage
    idpathLocationInfo LightBox ID required

    Response

    Media type: application/json

    Structure by LightBox Site ID

    Return structures that contain the site object identified by the LightBox Site 'ID.'

    GET /structures/_on/site/us/{id}

    Example Requests

    curl -X GET -H ‘x-api-key: (api_key)’ https://api.lightboxre.com/v1/structures/_on/site/us/0904YD6NQEZ3DPCJJG3E6U

    https://api.lightboxre.com/v1/structures/_on/site/us/0904YD6NQEZ3DPCJJG3E6U

    ParameterTypeDescriptionUsage
    idpathSite LightBox ID required

    Response

    Media type: application/json

    Structure WMS Endpoint

    Use within mapping systems that support OGC WMS Standard

    GET /wms/structures/us?apikey={your api key}

    Example Requests

    curl -X GET -H ‘x-api-key: (api_key)’ https://api.lightboxre.com/v1//wms/structures/us?apikey={your api key}

    https://api.lightboxre.com/v1/wms/structures/us?apikey={your api key}

    Parameters

    ParameterTypeDescriptionUsage
    apikeyqueryYour LightBox API Authenticationrequired

    Response

    Media type: XML/json/image 

    Structure Tile Endpoint

    Use within common map controls to show parcel boundaries as a tile overlay.

    GET /structures/{countryCode}/tile/{zoom}/{x}/{y}

    Example Requests

    curl -X GET -H ‘x-api-key: (api_key)’ https://api.lightboxre.com/v1/structures/us/tile/18/45050/104888

    https://api.lightboxre.com/v1/structures/us/tile/18/45050/104888

    Parameters

    ParameterTypeDescriptionUsage
    countryCodepathISO 3166 alpha-2 country code (e.g., 'US' for the United States).required
    zoompathTile zoom level, which can be a minimum of '13' and a maximum or '21.'required
    xpathTile column.required
    ypathTile row.required
    colorqueryLine color represented in RGB format.optional
    fillqueryFill color represented in RGB format.optional
    weightqueryLine weight represented in a number 1-10 with 1 being thin and 10 being thick.optional
    opacityqueryFill color opacity values 0-100 with 0 beingtransparent and 100 being opaque. optional
    idqueryThis parameter allows you to pass in a LightBox Structure ID or ids separated by a comma so that only those structures are displayed.optional
    Pro Tip: 
    Using the query parameter id allows you to isolate a single record to be displayed. This is typically used to mimic a highlight event by adding an additional tile layer on a map control with a single record isolated and displayed in a different color. 

    Response

    Media type: image/png

    Structure Tile Bounding Box Endpoint

    Use within common map controls to show parcel boundaries as a bounding box overlay.

    GET /structures/{countryCode}/tile

    Example Requests

    curl -X GET -H ‘x-api-key: (api_key)’ https://api.lightboxre.com/v1/structures/us/tile?bbox=-83.0434660625,40.0198659375,-83.04070793749999,40.0226240625&width=600&height=600

    https://api.lightboxre.com/v1/structures/us/tile?bbox=-83.0434660625,40.0198659375,-83.04070793749999,40.0226240625&width=600&height=600

    Parameters

    ParameterTypeDescriptionUsage
    countryCodepathISO 3166 alpha-2 country code (e.g., 'us' for the United States).required
    bboxqueryA bounding box expressed in the NAD83 projected coordinate system.required
    widthqueryWidth of the result image.required
    heightqueryHeight of the result image.required
    colorqueryLine color represented in RGB format.optional
    fillqueryFill color represented in RGB format.optional
    weightqueryLine weight represented in a number 1-10 with 1 being thin and 10 being thick.optional
    opacityqueryFill color opacity values 0-100 with 0 beingtransparent and 100 being opaque. optional
    idqueryThis parameter allows you to pass in a LightBox Parcel ID or ids separated by a comma so that only those parcels are displayed. optional

    Response

    Media type: image/png

    API Response

    For each endpoint other than the tile requests and health check, the response will stay consistent. 

    {
      "$ref": "string",
      "$metadata": {
        "geogcs": {
          "epsg": "4326"
        },
        "recordSet": {
          "totalRecords": 99,
          "limit: 100,
          "offset: 10,
          "bbox": {
            "xMax": -105.250409,
            "xMin": -105.251916,
            "yMax": 40.023629,
            "yMin": 40.022576
          }
        },
        "units": {
          "length": "ft",
          "area": "sqft"
        }
      },
      "structures": [
        {
          "$ref": "string",
          "fips": "06059",
          "ubid": "87G7MV2G+CW5-15-48-19-40",
          "id": "string",
          "$metadata": {
            "geocode": {
              "confidence": {
                "streetNumber": 1,
                "streetName": 1,
                "locality": 1,
                "postalCode": 1,
                "score": 1
              },
              "precisionCode": 0
            }
          },
          "location": {
            "streetAddress": "string",
            "locality": "string",
            "regionCode": "AL",
            "postalCode": "string",
            "postalCodeExt": "string",
            "unit": "string",
            "countryCode": "US",
            "representativePoint": {
              "longitude": 0,
              "latitude": 0,
              "geometry": {
                "wkt": "string"
              }
            },
            "geometry": {
              "wkt": "string"
            }
          },
          "physicalFeatures": {
            "height": {
              "average": 0,
              "max": 0,
              "min": 0
            },
            "groundElevation": {
              "average": 0,
              "max": 0,
              "min": 0
            },
            "area": {
              "footprintArea": 0
            },
            "numberOfStories": 5.0 
          },
          "propertyClass": "string",
          "parcelCount": 0,
          "business": true,
          "parcels": [
            {
              "$ref": "string",
              "id": "string"
              "primaryBuilding" : true
            }
          ]
        }
      ]
    }

    Field Dictionary

    FieldTypeDescription
    ubidstringUniversal building ID.
    idstringLightBox ID for this structure.
    location.streetAddressstringStreet address, which comprises street name, street directional prefix, street number, street suffix, unit type, and unit number (e.g., '125 Main Street S Unit 5').
    location.localitystringThe city portion of the address (e.g., CHICAGO, ATLANTA, DENVER, etc.).
    location.regionCodestringThe two-letter state code of the address(e.g., CA, NV, WA, etc.).
    location.postalCodestringPostal Code portion of the address (e.g., 92675).
    location.postalCodeExtstringThe four-digit code of the address. Also referred to as the 'plus 4 code' and the 'add on code.' Used by the US Postal Service to identify a geographic segment within a five-digit postal ZIP code (e.g., 5437).
    location.countryCodestringISO 3166 alpha-2 country code (e.g., 'US' for the United States).
    location.representativePoint.longitudedoubleA geographic coordinate that specifies the east-west position of a point on the Earth's surface, or the surface of a celestial body.
    location.representativePoint.latitudedoubleA geographic coordinate that specifies the north-south position of a point on the Earth's surface, or the surface of a celestial body.
    location.representativePoint.geometry.wktstringThe geometry of the location expressed in WKT (well-known text) format.
    location.geometrystringThe geometry of the location expressed in WKT (well-known text) format.
    physicalFeatures.height.averagefloatAverage height of the structure.
    physicalFeatures.height.maxfloatMax height of the structure.
    physicalFeatures.height.minfloatMin height of the structure.
    physicalFeatures.groundElevation.averagefloatAverage ground elevation of the structure.
    physicalFeatures.groundElevation.maxfloatMax ground elevation of the structure.
    physicalFeatures.groundElevation.minfloatMin ground elevation of the structure.
    physicalFeatures.area.footPrintAreafloatStructure footprint area.
    numberOfStoriesintegerThe number of stories this structure has.
    propertyClassstringProperty class on which the structure stands.
    parcelCountnumberThe number of parcels that this structure touches.
    businessbooleanTrue/False if this building is a business.
    parcels[].$refstringAPI url that references this related parcel
    parcels[].idstringLightBox parcel id that links back to the related parcel
    parcels[].primaryBuildingbooleanIf true then this structure is the primary structure for this related parcel

    HTTP Error Codes

    HTTP Response status codes along with a brief summary of their commonly accepted usage. These status codes are returned by LightBox APIs for each request:
    200
    The request succeeded.
    201
    The object was created successfully
    202Accepted, no content
    204Successful, no content
    204
    The server has successfully fulfilled the request and that there is no additional content to send in the response payload body. Typically returned on a DELETE
    400
    One or more of the request parameters were invalid.
    401
    The client must authenticate itself to get the requested response. Note: This could also be due to your trial key has expired.
    404
    The server cannot find the requested resource. This can also mean that the endpoint is valid but the resource itself does not exist.
    429
    Too many requests were made in a short period of time, or you have exceeded your request-lot pool.
    500
    The server has encountered an error it does not know how to handle.
    503Service Unavailable.





    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.