Banner: Web API: Get job by ID

Web API: Get job by ID

Get job by ID

'Get job by ID' is an API that enables developers to retrieve a specific job posting by ID. You can get the ID from the API, "List Jobs". The returned object contains details about one job posting from National Labor Exchange. The search recognizes the O*NET taxonomy created by the Department of Labor for cross-agency use by federal, state and local government entities. 

About this data

'Get Job by ID V2' API is used in the CareerOneStop Job Finder Tool. For more information about the data, read the Job Finder Help Page. Submit a data request through NLX (The National Labor Exchange) to access the CareerOneStop Jobs API for posting jobs. You can also check out the NASWA Research Hub for information on using the Jobs data for analytical or research purposes. Click here for more information about recent updates.

Resource URL

https://api.careeronestop.org/v2/jobsearch/{userId}/{JvId}

Example Code

using System;

using System.Net.Http;

using System.Net.Http.Headers;

using System.Threading.Tasks;

using System.Collections.Specialized;

using System.Linq;

namespace CareerOneStopAPISample

{

    class Program

    {

        static void Main(string[] args)

        {

            CreateRequest().Wait();

        }

        private static async Task CreateRequest()

        {

            var qs = new NameValueCollection();

            qs["companyName"] = "value";                       

           

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

            {

                Path = "/v2/jobsearch/{userId}/{searchId}",

                Query = string.Join("&", qs.AllKeys.Select(key => key + "=" + Uri.EscapeUriString(qs[key])))

            };

           

            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/jobsearch/{userId}/{searchId}")

                .setParameter("companyName", "value")

        .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
JvId
String
Required
This value is the unique ID for the job. It can be obtained from the List Jobs API.
isHtml
boolean Optional Use this parameter to determine whether to include HTML in the Description response parameter.
True- Include html (default)
False - exclude html.
enableMetaData
boolean Optional
Use this parameter to determine whether to include MetaData in the response.
True- Include metadata 
False - exclude metadata (default)

Response Structure

{
  "JobTitle": "Registered Nurse/Licensed Practical Nurse",
  "URL": "https://de.jobsyn.org/7f6f3a72600c4085878258d22d81a9878003",
  "Company": "Haralson Nursing & Rehabilitation Center",
  "Location": "Bremen, GA",
  "AcquisitionDate": "2024-05-22T07:00:07-04:00",
  "Description": "
Salary: $28 - $32 per hour\r\n\r\n
Shift Type:\r\n\r\n
Available Hours: Full-time and Part-time (includes weekend rotation)\r\n\r\n
Morning Shift (7:00 am-7:00 pm)\r\n\r\n
Night Shift (7:00 pm-7:00 am)\r\n\r\n
Benefits:\r\n\r\n\r\n
\r\nHealth
\r\n\r\n\r\nDental
\r\n\r\n\r\nVision
\r\n\r\n\r\nFree Life Insurance
\r\n\r\n\r\nPTO available
\r\n\r\n\r\n
\r\n
Haralson and Rehab a long-term care and skilled nursing facility located in Cedartown, GA is looking to expand our team!  We are searching for responsible, highly professional, enthusiastic, and compassionate LPNs to provide the utmost care to our residents.  Our staff takes pride in working at our facility and we are looking for staff to become a part of the Haralson Family.\r\n\r\n
The hiring team at Haralson Nursing and Rehab look forward to hearing from You!\r\n\r\n
IND123\r\n\r\n",
  "OnetCodes": [
    "29206100",
    "29114100",
    "29114103"
  ],
  "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": "2024-07-09T13:17:56",
    "CitationSuggested": "This data is delivered by an API from CareerOneStop, sponsored by U.S. Department of Labor, Employment and Training Administration.  www.careeronestop.org Job postings come from NLx (www.usnlx.com), by the National Labor Exchange, which is co-sponsored by the Direct Employers Association (www.directemployers.org) and the National Association of State Workforce Agencies (www.naswa.org).",
    "DataSource": [
      {
        "DataName": "NLx job postings",
        "DataSourceName": "NLx, National Labor Exchange",
        "DataSourceUrl": "http://nlx.org/",
        "DataLastUpdate": "Rolling (via API)",
        "DataVintageOrVersion": "Rolling (via API)",
        "DataDescription": "Job postings come from NLx (www.usnlx.com), by the National Labor Exchange, which is co-sponsored by the Direct Employers Association (www.directemployers.org) and the National Association of State Workforce Agencies (www.naswa.org). The data include jobs posted on state job banks as well as by private employers. ",
        "DataSourceCitation": "Job postings come from NLx (www.usnlx.com), by the National Labor Exchange, which is co-sponsored by the Direct Employers Association (www.directemployers.org) and the National Association of State Workforce Agencies (www.naswa.org)."
      }
    ]
  }
}
<JobDetailsById
xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://schemas.datacontract.org/2004/07/XPAND.CareerOneStop.WebApi.ViewModels">
<JobTitle>Registered Nurse/Licensed Practical Nurse</JobTitle>
<URL>https://de.jobsyn.org/7f6f3a72600c4085878258d22d81a9878003</URL>
<Company>Haralson Nursing & Rehabilitation Center</Company>
<Location>Bremen, GA</Location>
<AcquisitionDate>2024-05-22T07:00:07-04:00</AcquisitionDate>
<Description>

Salary: $28 - $32 per hour

Shift Type:

Available Hours: Full-time and Part-time (includes weekend rotation)

Morning Shift (7:00 am-7:00 pm)

Night Shift (7:00 pm-7:00 am)

Benefits:

Health

Dental

Vision

Free Life Insurance

PTO available

Haralson and Rehab a long-term care and skilled nursing facility located in Cedartown, GA is looking to expand our team! We are searching for responsible, highly professional, enthusiastic, and compassionate LPNs to provide the utmost care to our residents. Our staff takes pride in working at our facility and we are looking for staff to become a part of the Haralson Family.

The hiring team at Haralson Nursing and Rehab look forward to hearing from You!

IND123

</Description>
<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 Job postings come from NLx (www.usnlx.com), by the National Labor Exchange, which is co-sponsored by the Direct Employers Association (www.directemployers.org) and the National Association of State Workforce Agencies (www.naswa.org).</d2p1:CitationSuggested>
<d2p1:DataSource>
<d2p1:MetaDataSource>
<d2p1:DataDescription>Job postings come from NLx (www.usnlx.com), by the National Labor Exchange, which is co-sponsored by the Direct Employers Association (www.directemployers.org) and the National Association of State Workforce Agencies (www.naswa.org). The data include jobs posted on state job banks as well as by private employers. </d2p1:DataDescription>
<d2p1:DataLastUpdate>Rolling (via API)</d2p1:DataLastUpdate>
<d2p1:DataName>NLx job postings</d2p1:DataName>
<d2p1:DataSourceCitation>Job postings come from NLx (www.usnlx.com), by the National Labor Exchange, which is co-sponsored by the Direct Employers Association (www.directemployers.org) and the National Association of State Workforce Agencies (www.naswa.org).</d2p1:DataSourceCitation>
<d2p1:DataSourceName>NLx, National Labor Exchange</d2p1:DataSourceName>
<d2p1:DataSourceUrl>http://nlx.org/</d2p1:DataSourceUrl>
<d2p1:DataVintageOrVersion>Rolling (via API)</d2p1:DataVintageOrVersion>
</d2p1:MetaDataSource>
</d2p1:DataSource>
<d2p1:LastAccessDate>2024-07-05T15:32:03</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>
</JobDetailsById>

Response Parameters

Name
Description
Type
Parent
JobTitle
Job title
String
Empty Cell
URL
Job URL
String
Empty Cell
Company
Job company
String
Empty Cell
Location
Job location
String
Empty Cell
AcquisitionDate
Acquisition date
String
Empty Cell
Description
Description of the job. This is often very long.
String
Empty Cell
OnetCodes
Codes for one or more O*NET occupations associated with this title. These are assigned using an automated process that is far from perfect.
List of strings
Empty Cell
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 UTC (ISO 8601) format
String
MetaData
CitationSuggested
If you use this data, CareerOneStop suggests you use this citation.
String
MetaData
DataSource
The data source object(s)
List of Objects
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.