Banner: Web API: Get Employment Patterns

Web API: Get Employment Patterns

Employment Patterns

The 'Get Employment Patterns' API enables developers to input an occupation and get data about the industries in which at least two percent of the workers in this occupation are employed. The API accepts O*NET and SOC Codes and Titles.

About this data

The Employment Patterns tool demonstrates how this API can be used. For more information about the data, please visit that tool's help page.

Resource URL

https://api.careeronestop.org/v1/employmentpatterns/{userId}/{keyword}/{sortColumns}/{sortDirections}/{startRecord}/{limitRecord}

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/employmentpatterns/{userId}/{keyword}/{sortColumns}/{sortDirections}/{startRecord}/{limitRecord}"

            };

           

            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/employmentpatterns/{userId}/{keyword}/{sortColumns}/{sortDirections}/{startRecord}/{limitRecord}")

        .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
Yes
This value is the unique API Token provided during the CareerOneStop Web API registration process.
userId
String
Yes
This value is the unique UserID provided during the CareerOneStop Web API registration process.
keyword String
Yes
This value accepts a search term, which must be an occupation  (O*NET or SOC title or code).
sortColumns
String Yes

This is the column by which the data should be sorted. Acceptable values include:
0 - relevance (default)
PCT - Percent ("Share") of workers in this occupation who are working in this industry
IND - Industry title
EE - Estimated employment, for the earlier year
PE - Projected employment, for the later year
PCH - Percent change

sortDirections 
String Yes

Sort Direction Acceptable values include:
0 - Ascending (default)
ASC - Ascending
DESC - Descending

startRecord
Integer
Yes This value is to set the starting record. Default value 0 is for the first record.
limitRecord
Integer
Yes This value sets the limit of the maximum number of records to be returned. Default value is 10.
enableMetaData
boolean
Optional Use this parameter to determine whether to include MetaData in the response.
True- Include metadata (default)
False - exclude metadata

Response Structure

{
  "RecordCount": 8,
  "SocTitle": "Registered Nurses",
  "SocCode": "291141",
  "Code": "29-1141.00",
  "Title": "Registered Nurses",
  "EstYear": "2018",
  "ProjYear": "2028",
  "Request": {
    "Keyword": "Registered Nurses",
    "SortColumns": null,
    "SortDirections": null,
    "StartRecord": 1,
    "LimitRecord": 10
  },
  "Result": [
    {
      "IagCode": null,
      "Pctestocc": 2.9,
      "Industry": "Federal government, excluding postal service",
      "MatInCode": "999100",
      "ProjectEmployment": 89300,
      "EstimatedEmployment": 88800,
      "PercentChange": 0.5,
      "NumberChanged": 500
    },
    {
      "IagCode": "622",
      "Pctestocc": 6,
      "Industry": "General medical and surgical hospitals; local",
      "MatInCode": "622103",
      "ProjectEmployment": 189700,
      "EstimatedEmployment": 183100,
      "PercentChange": 3.6,
      "NumberChanged": 6500
    },
    {
      "IagCode": "622",
      "Pctestocc": 48.1,
      "Industry": "General medical and surgical hospitals; private",
      "MatInCode": "622105",
      "ProjectEmployment": 1583200,
      "EstimatedEmployment": 1471300,
      "PercentChange": 7.6,
      "NumberChanged": 112000
    },
    {
      "IagCode": "622",
      "Pctestocc": 2.2,
      "Industry": "General medical and surgical hospitals; state",
      "MatInCode": "622102",
      "ProjectEmployment": 73400,
      "EstimatedEmployment": 66900,
      "PercentChange": 9.7,
      "NumberChanged": 6500
    },
    {
      "IagCode": "621",
      "Pctestocc": 6,
      "Industry": "Home healthcare services",
      "MatInCode": "621600",
      "ProjectEmployment": 271000,
      "EstimatedEmployment": 184100,
      "PercentChange": 47.2,
      "NumberChanged": 86900
    },
    {
      "IagCode": "623",
      "Pctestocc": 5,
      "Industry": "Nursing care facilities (skilled nursing facilities)",
      "MatInCode": "623100",
      "ProjectEmployment": 147900,
      "EstimatedEmployment": 153000,
      "PercentChange": -3.3,
      "NumberChanged": -5100
    },
    {
      "IagCode": "621",
      "Pctestocc": 6.5,
      "Industry": "Offices of physicians",
      "MatInCode": "621100",
      "ProjectEmployment": 223800,
      "EstimatedEmployment": 200100,
      "PercentChange": 11.8,
      "NumberChanged": 23700
    },
    {
      "IagCode": "622",
      "Pctestocc": 2.2,
      "Industry": "Specialty (except psychiatric and substance abuse) hospitals; private",
      "MatInCode": "622305",
      "ProjectEmployment": 94100,
      "EstimatedEmployment": 67300,
      "PercentChange": 39.8,
      "NumberChanged": 26800
    }
  ],
  "MetaData": {
    "Publisher": "CareerOneStop publishes this API (www.careeronestop.org/Developers/WebAPI/web-api.aspx)",
    "Sponsor": "U.S. Department of Labor, Employment and Training Administration",
    "LastAccessDate": 1606333964,
    "CitationSuggested": "This data is delivered by an API from CareerOneStop, sponsored by U.S. Department of Labor, Employment and Training Administration.  \nwww.careeronestop.org\nNational employment projections come from the U.S. Department of Labor, Bureau of Labor Statistics, Employment Projections program, Employment by detailed occupation, 2018 and projected 2028 (www.bls.gov/emp/).",
    "DataSource": [
      {
        "DataName": "National employment projections",
        "DataSourceName": "U.S. Department of Labor, Bureau of Labor Statistics Employment Projections program",
        "DataSourceUrl": "https://www.bls.gov/emp/",
        "DataLastUpdate": "September 2019",
        "DataVintageOrVersion": "2018-28",
        "DataDescription": "The Employment Projections (EP) program develops information about the labor market for the nation as a whole for 10 years in the future, by occupation and by industry.",
        "DataSourceCitation": "National employment projections come from the U.S. Department of Labor, Bureau of Labor Statistics, Employment Projections program, Employment by detailed occupation, 2018 and projected 2028 (www.bls.gov/emp/)."
      }
    ]
  }
}
<EmploymentPatternViewModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/XPAND.CareerOneStop.WebApi.ViewModels">
<Code>29-1141.00</Code>
<EstYear>2018</EstYear>
<MetaData xmlns:d2p1="http://schemas.datacontract.org/2004/07/XPAND.CareerOneStop.WebApi.Core.MetaData">
<d2p1:CitationSuggested>This data is delivered by an API from CareerOneStop, sponsored by U.S. Department of Labor, Employment and Training Administration. www.careeronestop.org National employment projections come from the U.S. Department of Labor, Bureau of Labor Statistics, Employment Projections program, Employment by detailed occupation, 2018 and projected 2028 (www.bls.gov/emp/).</d2p1:CitationSuggested>
<d2p1:DataSource>
<d2p1:MetaDataSource>
<d2p1:DataDescription>The Employment Projections (EP) program develops information about the labor market for the nation as a whole for 10 years in the future, by occupation and by industry.</d2p1:DataDescription>
<d2p1:DataLastUpdate>September 2019</d2p1:DataLastUpdate>
<d2p1:DataName>National employment projections</d2p1:DataName>
<d2p1:DataSourceCitation>National employment projections come from the U.S. Department of Labor, Bureau of Labor Statistics, Employment Projections program, Employment by detailed occupation, 2018 and projected 2028 (www.bls.gov/emp/).</d2p1:DataSourceCitation>
<d2p1:DataSourceName>U.S. Department of Labor, Bureau of Labor Statistics Employment Projections program</d2p1:DataSourceName>
<d2p1:DataSourceUrl>https://www.bls.gov/emp/</d2p1:DataSourceUrl>
<d2p1:DataVintageOrVersion>2018-28</d2p1:DataVintageOrVersion>
</d2p1:MetaDataSource>
</d2p1:DataSource>
<d2p1:LastAccessDate>1606335981</d2p1:LastAccessDate>
<d2p1:Publisher>CareerOneStop publishes this API (www.careeronestop.org/Developers/WebAPI/web-api.aspx)</d2p1:Publisher>
<d2p1:Sponsor>U.S. Department of Labor, Employment and Training Administration</d2p1:Sponsor>
</MetaData>
<ProjYear>2028</ProjYear>
<RecordCount>8</RecordCount>
<Request xmlns:d2p1="http://schemas.datacontract.org/2004/07/API.CareerOneStop.DTO">
<d2p1:SocCode>291141</d2p1:SocCode>
</Request>
<Result>
<EmploymentPattern>
<EstimatedEmployment>88800</EstimatedEmployment>
<IagCode i:nil="true"/>
<Industry>Federal government, excluding postal service</Industry>
<MatInCode>999100</MatInCode>
<NumberChanged>500</NumberChanged>
<Pctestocc>2.90</Pctestocc>
<PercentChange>0.50</PercentChange>
<ProjectEmployment>89300</ProjectEmployment>
</EmploymentPattern>
<EmploymentPattern>
<EstimatedEmployment>183100</EstimatedEmployment>
<IagCode>622</IagCode>
<Industry>General medical and surgical hospitals; local</Industry>
<MatInCode>622103</MatInCode>
<NumberChanged>6500</NumberChanged>
<Pctestocc>6</Pctestocc>
<PercentChange>3.60</PercentChange>
<ProjectEmployment>189700</ProjectEmployment>
</EmploymentPattern>
<EmploymentPattern>
<EstimatedEmployment>1471300</EstimatedEmployment>
<IagCode>622</IagCode>
<Industry>General medical and surgical hospitals; private</Industry>
<MatInCode>622105</MatInCode>
<NumberChanged>112000</NumberChanged>
<Pctestocc>48.10</Pctestocc>
<PercentChange>7.60</PercentChange>
<ProjectEmployment>1583200</ProjectEmployment>
</EmploymentPattern>
<EmploymentPattern>
<EstimatedEmployment>66900</EstimatedEmployment>
<IagCode>622</IagCode>
<Industry>General medical and surgical hospitals; state</Industry>
<MatInCode>622102</MatInCode>
<NumberChanged>6500</NumberChanged>
<Pctestocc>2.20</Pctestocc>
<PercentChange>9.70</PercentChange>
<ProjectEmployment>73400</ProjectEmployment>
</EmploymentPattern>
<EmploymentPattern>
<EstimatedEmployment>184100</EstimatedEmployment>
<IagCode>621</IagCode>
<Industry>Home healthcare services</Industry>
<MatInCode>621600</MatInCode>
<NumberChanged>86900</NumberChanged>
<Pctestocc>6</Pctestocc>
<PercentChange>47.20</PercentChange>
<ProjectEmployment>271000</ProjectEmployment>
</EmploymentPattern>
<EmploymentPattern>
<EstimatedEmployment>153000</EstimatedEmployment>
<IagCode>623</IagCode>
<Industry>Nursing care facilities (skilled nursing facilities)</Industry>
<MatInCode>623100</MatInCode>
<NumberChanged>-5100</NumberChanged>
<Pctestocc>5</Pctestocc>
<PercentChange>-3.30</PercentChange>
<ProjectEmployment>147900</ProjectEmployment>
</EmploymentPattern>
<EmploymentPattern>
<EstimatedEmployment>200100</EstimatedEmployment>
<IagCode>621</IagCode>
<Industry>Offices of physicians</Industry>
<MatInCode>621100</MatInCode>
<NumberChanged>23700</NumberChanged>
<Pctestocc>6.50</Pctestocc>
<PercentChange>11.80</PercentChange>
<ProjectEmployment>223800</ProjectEmployment>
</EmploymentPattern>
<EmploymentPattern>
<EstimatedEmployment>67300</EstimatedEmployment>
<IagCode>622</IagCode>
<Industry>Specialty (except psychiatric and substance abuse) hospitals; private</Industry>
<MatInCode>622305</MatInCode>
<NumberChanged>26800</NumberChanged>
<Pctestocc>2.20</Pctestocc>
<PercentChange>39.80</PercentChange>
<ProjectEmployment>94100</ProjectEmployment>
</EmploymentPattern>
</Result>
<SocCode>291141</SocCode>
<SocTitle>Registered Nurses</SocTitle>
<Title>Registered Nurses</Title>
</EmploymentPatternViewModel>

Response Parameters

Name
Description
Type
Parent
RecordCount
Record Count
Integer
Empty Cell
SocTitle
Title of the SOC occupation corresponding to (or equalling) the user's input. If user input was an O*NET detail occupation, this field will be the corresponding SOC title.
String
Empty Cell
SocCode
The code for the SOC occupation corresponding to (or equalling) the user's input. If user input was an O*NET detail occupation, this field will be the corresponding SOC title. 
String
Empty Cell
Code
Code of the occupation that was input. Could be O*NET or SOC.
String
Empty Cell
Title
Title of the occupation that was input. Could be O*NET or SOC.
String
EstYear
Estimated employment
Decimal
Result
ProjYear
Projected employment
Decimal
Result
Request
The request parameter
Object
Empty Cell
Keyword
The user input itself; could be words or a code.
String
Request
SortColumns
Column by which the data is sorted. Acceptable values include
PCT - Share of this occupation working in this industry
IND - Industry title
EE - Estimated employment, for the earlier year
PE - Project employment, for the later year
PCH - Percent change
String
Request
SortDirections
Sort Direction. Default is 0=ASC. Acceptable values include:
ASC - Ascending
DESC - Descending
String
Request
StartRecord
Which record to start with, for this response? To start with the first record (first page), StartRecord is 0. Default is 0.
Integer
Request
LimitRecord
The number of records to return in this call. Default is 10.
Integer
Request
Result
List of industries in which at least 2% of the workers in this occupations are employed.
Object
Empty Cell
IagCode
BLS offers "Industries at a Glance" (IAG), profiles for many industries, at 2-digit ("supersector") and 3-digit ("sector") levels. IagCode is the 2- or 3- digit code for which BLS publishes a profile corresponding to this "Result".
CareerOneStop uses this code to construct a URL that we hyperlink from the industry title. For example, www.bls.gov/iag/tgs/iag61.htm
String
Result
Pctestocc
Share of Workers in this occupation that work in this industry. In the BLS EMP data, this is PctEstOcc.
Decimal
Result
Industry
Industry name
String
Result
MatInCode
Industry code, as used in the "micro matrix" published by BLS Employment projections program.
String
Result
ProjectEmployment
Projected employment (for the year 10 years past the year of the EstimatedEmployment).
Decimal
Result
EstimatedEmployment
Estimated Employment (for the earlier year).
Decimal
Result
PercentChange
Percent changed, between the two years
Decimal
Result
NumberChanged
Number changed, between the two years
Integer
Result
MetaData
Information about the source of the API
Object
Empty Cell
Publisher
Publisher of the API
String
MetaData
Sponsor
Sponsor of the API
String
MetaData
LastAccessDate           
When the API was run, using Unix "epoch" format. Convert to date and time using a Unix epoch converter.
String
MetaData
CitationSuggested
If you use this data, CareerOneStop suggests you use this citation.
String
MetaData
DataSource
The data source object(s)
Object
MetaData
DataName
Name of data
String
DataSource
DataSourceName
Name of data source
String
DataSource
DataSourceUrl
Url of data source
String
DataSource
DataLastUpdate
Date when CareerOneStop last updated this data
String
DataSource
DataVintageOrVersion
Version or vintage of the data
String
DataSource
DataDescription
Description of the data
String
DataSource
DataSourceCitation
Suggested citation for this data source
String
DataSource

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.