Banner: Web API: Get LMI by occupation

Web API: Get LMI by occupation

Get LMI by occupation

The 'Get LMI by Occupation' API enables developers to query and retrieve Labor Market Information (LMI) based on the given O*NET code. It provides a minimal set of occupation information including Average Pay, Career Outlook, and Typical Training.

About this data

This Web API provides a small piece of available Labor Market Information regarding wages and job outlook from the CareerOneStop Website. You can see this API used in the left column of the Professional Association Finder. More extensive occupational data is available through two other Web API's, "Get Occupation Details" and "List Occupations by Keyword".

Resource URL

https://api.careeronestop.org/v1/lmi/{userId}/{onetCode}/{location}

Example Code

using System;

using System.Net.Http;

using System.Net.Http.Headers;

using System.Threading.Tasks;

namespace CareerOneStopAPISample

{

    class Program

    {

        static void Main(string[] args)

        {

            CreateRequest().Wait();

        }

        private static async Task CreateRequest()

        {

            var uri = new UriBuilder(Uri.UriSchemeHttps, "api.careeronestop.org")

            {

                Path = "/v1/lmi/{userId}/{onetCode}/{location}"

            };

            

            using (var http = new HttpClient())

            {

                http.DefaultRequestHeaders.Accept.Clear();

                http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "Your API Token");

                http.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

                var response = await http.GetAsync(uri.Uri).ConfigureAwait(false);

                if (response.IsSuccessStatusCode)

                {

                    var result = await response.Content.ReadAsStringAsync().ConfigureAwait(false);

                }

            }

        }

    }

}
import java.io.IOException;

import java.net.URI;

import java.net.URISyntaxException;

import org.apache.http.HttpEntity;

import org.apache.http.client.methods.CloseableHttpResponse;

import org.apache.http.client.methods.HttpGet;

import org.apache.http.client.utils.URIBuilder;

import org.apache.http.impl.client.CloseableHttpClient;

import org.apache.http.impl.client.HttpClients;

import org.apache.http.util.EntityUtils;

public class CareerOneStopAPISample {

    public static void main(String[] args) throws IOException, URISyntaxException {

    URI uri = new URIBuilder()

        .setScheme("https")

        .setHost("api.careeronestop.org")

        .setPath("/v1/lmi/{userId}/{onetCode}/{location}")

        .build();

    CloseableHttpResponse response = null;

    HttpGet httpGet = null;

    try {

        CloseableHttpClient httpClient = HttpClients.createDefault();

        httpGet = new HttpGet(uri);

        httpGet.setHeader("Content-Type","application/json");

        httpGet.setHeader("Authorization", "Bearer Your API Token");

        response = httpClient.execute(httpGet);

        HttpEntity entity = response.getEntity();

        System.out.println(EntityUtils.toString(entity));

    } finally {

        if(httpGet != null) httpGet.releaseConnection();

        if(response != null) response.close();

    }

   }

}

Request Parameters

Refer to the following table for a list of the required and optional request parameters. All parameter names and values are case sensitive. Important: You must provide all required parameters. Submitting an empty request does not return all possible results; an empty request returns an error.

Parameter Name Value Required? Description
API Token
String
Required
This value is the unique API Token provided during the CareerOneStop Web API registration process.
userId
String
Required
This value is the unique UserID provided during the CareerOneStop Web API registration process.
onetCode
String
Required
This value is the O*NET Code for search term.
location
String
Required
This value accepts a city, state (Chicago, IL) or state (IL) or ZIP code (61299). For national data, give the numeral 0, or "US".

Response Structure

{

  "LMI": {

    "CareerOutLook": "Bright",

    "AveragePay_State": "94340",

    "AveragePay_Zip": "",

    "AveragePay_National": "98190",

    "TypicalTraining": "Master's degree"

  },

  "Location": ""

  "SocInfo": {

    "SocCode": "291171",

    "SocTitle": "Nurse Practitioners",

    "SocDescription": "Diagnose and treat acute, episodic, or chronic illness, independently or as part of a healthcare team. May focus on health promotion and disease prevention. May order, perform, or interpret diagnostic tests such as lab work and x rays. May prescribe medication. Must be registered nurses who have specialized graduate education."

  },

  "SocWageInfo": {

    "SocCode": "291171",

    "SocTitle": "Nurse Practitioners",

    "SocDescription": ""

  }

}
<LMIDetails xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/XPAND.CareerOneStop.WebApi.ViewModels">

  <LMI>

    <AveragePay_National>98190</AveragePay_National>

    <AveragePay_State>94340</AveragePay_State>

    <AveragePay_Zip/>

    <CareerOutLook>Bright</CareerOutLook>

    <TypicalTraining>Master's degree</TypicalTraining>

  </LMI>

  <Location/>

  <SocInfo>

  <SocCode>291171</SocCode>

  <SocDescription>Diagnose and treat acute, episodic, or chronic illness, independently or as part of a healthcare team. May focus on health promotion and disease prevention. May order, perform, or interpret diagnostic tests such as lab work and x rays. May prescribe medication. Must be registered nurses who have specialized graduate education.</SocDescription>

  <SocTitle>Nurse Practitioners</SocTitle>

  </SocInfo>

  <SocWageInfo>

  <SocCode>291171</SocCode>

  <SocDescription/>

  <SocTitle>Nurse Practitioners</SocTitle>

  </SocWageInfo>

</LMIDetails>

Response Parameters

Name
Description
Type
Parent
Empty Cell
LMI
Labor Market Information
Object
Empty Cell
CareerOutLook
Career Outlook
String
LMI
AveragePayState
Average Pay by State
String
LMI
AveragePayZip
Average Pay by Zip
String
LMI
AveragePayNational
Average National Pay
String
Empty Cell
TypicalTraining
Typical Training
String
AveragePayNational
Location
If "location" request parameter is a ZIP code, this string is the name of the corresponding MSA.
String
Empty Cell
SocInfo
Corresponding SOC occupation 
Object
LMI
SocCode
SOC occupation code
String
SocInfo
SocDescription
SOC occupation description
String
SocInfo
SocTitle
SOC occupation title
String
SocInfo
SocWageInfo
If wages for the input occupation are provided at an OES-specific occupation (more broad than the corresponding SOC), then SocWageInfo identifies that corresponding OES occupation. 
Object
LMI
SocCode
OES occupation code
String
SocWageInfo
SocDescription
Always empty
String
SocWageInfo
SocTitle
OES occupation title
String
SocWageInfo

Errors

Error/Status Code Description
 200
OK / Success. The request went through successfully and there is a response body.
 400
Bad Request (Request was invalid or missing parameters)
 401    
Unauthorized. This error occurs specifically when authentication is required and has failed or has not yet been provided correctly. (ex: Invalid API Token)
 404
This error will be shown in two scenarios 1) Not found - (An error occurred) and 2) Not found - (No data available)
 500
Internal Server Error. This error will occur when there is something critically wrong in the API call.