Endpoint Examples

/distributions

Calculate data distributions based around numerical job posting fields such as salary and years of experience.

GET /distributions

Get a list of available distribution facets.

Code Examples

curl --request GET \
  --url https://api.lightcast.io/ca-jpa/distributions \
  --header 'Authorization: Bearer <ACCESS_TOKEN>'

Response Examples

{
  "data": [
    "salary",
    "min_years_experience",
    "max_years_experience"
  ]
}

POST /distributions/\{distributionFacet}

Get a data distribution by percentiles or fixed interval for a selected facet.

URL Parameters

NameTypeDescription
distributionFacetenum

The facet used as the domain of the distribution.

Example: salary

Must be one of: max_years_experience, min_years_experience, posting_duration, salary

Query Parameters

NameTypeDescription
noc_versionenum

Specify NOC taxonomy version to use.
This parameter is optional.
Default: ca_noc2021

Must be one of: ca_noc2021

company_versionenum

Specify company taxonomy version to use.
This parameter is optional.
Default: emsi_company

Must be one of: emsi_company

area_versionenum

Specify area taxonomy version to use.
This parameter is optional.
Default: ca_area_sgc2016

Must be one of: ca_area_sgc2016, ca_area_sgc2021

area_ca_versionenum

Specify area taxonomy version to use.
This parameter is optional.
Default: 2021.0.0

Must be one of: 2021.0.0, 2016.0.0

new_taxonomy_versionsenum

Use new taxonomy versions.
This parameter is optional.

Must be one of: true, false

lot_versionenum

Specify LOT taxonomy version to use.
This parameter is optional.
Default: 7

Must be one of: 6, 7

naics_versionenum

Specify NAICS taxonomy version to use.
This parameter is optional.
Default: naics_std_2017

Must be one of: naics_std_2017, naics_std_2022

naics_standard_versionenum

Specify NAICS taxonomy version to use.
This parameter is optional.
Default: 2017.0.1

Must be one of: 2017.0.1, 2022.0.0

Request Body

{
  "filter": {
    "when": "active"
  },
  "distribution": {
    "type": "percentile",
    "options": {
      "keys": [
        25,
        50,
        75
      ]
    },
    "metrics": [
      "unique_postings",
      "duplicate_postings"
    ]
  }
}

Code Examples

curl --request POST \
  --url https://api.lightcast.io/ca-jpa/distributions/salary \
  --header 'Authorization: Bearer <ACCESS_TOKEN>' \
  --header 'Content-Type: application/json' \
  --data '{ "filter": { "when": "active" }, "distribution": { "type": "percentile", "options": { "keys": [ 25, 50, 75 ] }, "metrics": [ "unique_postings", "duplicate_postings" ] } }'

Response Examples

{
  "data": {
    "distribution": {
      "buckets": [
        {
          "duplicate_postings": 116969,
          "key": 25,
          "unique_postings": 69451,
          "value": 36401
        },
        {
          "duplicate_postings": 237406,
          "key": 50,
          "unique_postings": 134014,
          "value": 45001
        },
        {
          "duplicate_postings": 377764,
          "key": 75,
          "unique_postings": 200280,
          "value": 59671
        }
      ],
      "domain": {
        "max": 500000,
        "min": 15682
      },
      "facet": "salary",
      "interval": null,
      "type": "percentile"
    },
    "totals": {
      "duplicate_postings": 1228637,
      "unique_postings": 663621
    }
  }
}
//Your request wasn't valid (bad parameter names or values).

{
  "errors": [
    {
      "status": 400,
      "title": "Malformed Request",
      "detail": "Expected array"
    }
  ]
}
//Your request wasn't unauthorized.

{
  "errors": [
    {
      "status": 401,
      "title": "Unauthorized Request",
      "detail": "You are not authorized to access this resource."
    }
  ]
}
//The facet you requested wasn't found.

{
  "errors": [
    {
      "status": 404,
      "title": "URL not found",
      "detail": "Unrecognized facet 'foo'"
    }
  ]
}
//Your request wasn't valid (bad keyword expression).

{
  "errors": [
    {
      "status": 422,
      "title": "Invalid request content",
      "detail": "Invalid keyword search expression syntax:\n\t\"general merchandise\" OR \"apparel\" OR \"grocery\" OR\n\t                                                  ^"
    }
  ]
}