The 'List Occupations by Skills Match' API enables developers to input one occupation and location, and get a list of occupations that use similar skills and knowledge. For each of those matching occupations, the API provides data about the wages, typical education and training levels at entry, and other data.
About this data
Data in the API come from U.S. Department of Labor and other sources, detailed here. This API is designed to support MySkills MyFuture; that tool demonstrates some of the things your could do with the API.
Resource URL
https://api.careeronestop.org/v1/occupation/{userId}/{onetCode}/{location}/{radius}
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/occupation/{userId}/{onetCode}/{location}/{radius}"
};
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/occupation/{userId}/{onetCode}/{location}/{radius}")
.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
{
"OccupationMatchResult": [
{
"AnnualWage": "string",
"BrightOutlook": true,
"EducationTitle": "string",
"GreenOccupation": true,
"HourlyWage": "string",
"JobCount": 6,
"OccupationCode": "string",
"OccupationDescription": "string",
"OccupationTitle": "string",
"MatchValue": 10.0,
"VideoCode": "string",
"VideoTitle": "string",
"AnnualWageRate": {
"Percentile10": 1.0,
"Percentile25": 2.0,
"Median": 3.0,
"Percentile75": 4.0,
"Percentile90": 5.0
},
"HourlyWageRate": {
"Percentile10": 1.0,
"Percentile25": 2.0,
"Median": 3.0,
"Percentile75": 4.0,
"Percentile90": 5.0
}
}
],
"TotalRecords": 1,
"MetaData": {
"Publisher": "string",
"Sponsor": "string",
"LastAccessDate": 3,
"CitationSuggested": "string",
"DataSource": [
{
"DataName": "string",
"DataSourceName": "string",
"DataSourceUrl": "string",
"DataLastUpdate": "string",
"DataVintageOrVersion": "string",
"DataDescription": "string"
"DataSourceCitation": "string"
}
]
}
}
<OccupationMatchResultViewModel
xmlns="http://schemas.datacontract.org/2004/07/XPAND.CareerOneStop.WebApi.ViewModels"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<MetaData xmlns:d2p1="http://schemas.datacontract.org/2004/07/XPAND.CareerOneStop.WebApi.Core.MetaData">
<d2p1:CitationSuggested>string</d2p1:CitationSuggested>
<d2p1:DataSource>
<d2p1:MetaDataSource>
<d2p1:DataDescription>string</d2p1:DataDescription>
<d2p1:DataLastUpdate>string</d2p1:DataLastUpdate>
<d2p1:DataName>string</d2p1:DataName>
<d2p1:DataSourceName>string</d2p1:DataSourceName>
<d2p1:DataSourceUrl>string</d2p1:DataSourceUrl>
<d2p1:DataVintageOrVersion>string</d2p1:DataVintageOrVersion>
<d2p1:DataSourceCitation>string</d2p1:DataSourceCitation>
</d2p1:MetaDataSource> </d2p1:DataSource>
<d2p1:LastAccessDate>3</d2p1:LastAccessDate>
<d2p1:Publisher>string</d2p1:Publisher>
<d2p1:Sponsor>string</d2p1:Sponsor>
</MetaData>
<OccupationMatchResult>
<OccupationMatch>
<AnnualWage>string</AnnualWage>
<AnnualWageRate xmlns:d4p1="http://schemas.datacontract.org/2004/07/API.CareerOneStop.DTO.MySkillsMyFuture">
<d4p1:Median>3</d4p1:Median>
<d4p1:Percentile10>1</d4p1:Percentile10>
<d4p1:Percentile25>2</d4p1:Percentile25>
<d4p1:Percentile75>4</d4p1:Percentile75>
<d4p1:Percentile90>5</d4p1:Percentile90>
</AnnualWageRate>
<BrightOutlook>true</BrightOutlook>
<EducationTitle>string</EducationTitle>
<GreenOccupation>true</GreenOccupation>
<HourlyWage>string</HourlyWage>
<HourlyWageRate xmlns:d4p1="http://schemas.datacontract.org/2004/07/API.CareerOneStop.DTO.MySkillsMyFuture">
<d4p1:Median>3</d4p1:Median>
<d4p1:Percentile10>1</d4p1:Percentile10>
<d4p1:Percentile25>2</d4p1:Percentile25>
<d4p1:Percentile75>4</d4p1:Percentile75>
<d4p1:Percentile90>5</d4p1:Percentile90>
</HourlyWageRate>
<JobCount>6</JobCount>
<MatchValue>10</MatchValue>
<OccupationCode>string</OccupationCode>
<OccupationDescription>string</OccupationDescription>
<OccupationTitle>string</OccupationTitle>
<VideoCode>string</VideoCode>
<VideoTitle>string</VideoTitle>
</OccupationMatch>
</OccupationMatchResult>
<TotalRecords>1</TotalRecords>
</OccupationMatchResultViewModel>
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.
|