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.
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
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. |