fetchJob
This method allows you to retrieve job data.
typescript
try {
const workflow = await linkedapi.fetchJob.execute({
jobUrl: "https://www.linkedin.com/jobs/view/4416248954/"
});
const { data, errors } = await linkedapi.fetchJob.result(workflow.workflowId);
// The list of possible execution errors is below
if (errors && errors.length > 0) {
console.warn('Workflow completed with execution errors:');
errors.forEach(error => {
console.warn(` - Type: ${error.type}, Message: ${error.message}`);
});
}
// The structure of the 'data' object is below
if (data) {
console.log('Workflow completed successfully. Data:', data);
}
} catch (e) {
// A list of all critical errors can be found here:
// https://linkedapi.io/sdks/handling-results-and-errors/#handling-critical-errors
if (e instanceof LinkedApiError) {
console.error(`Critical Error - Type: ${e.type}, Message: ${e.message}`);
} else {
console.error('An unexpected, non-API error occurred:', e);
}
}Params
jobUrl– LinkedIn URL of the job.
Data
jobId– LinkedIn job identifier.jobUrl– normalized LinkedIn job URL.title– job title.companyName– company name, if available.companyUrl– normalized LinkedIn company URL, if available.location– free-form job location, if available.postedDate– compact relative date, such as1w,3d, or2mo, if available.applicantsCount– number of applicants, if LinkedIn shows it.workplaceType– workplace type label as shown by LinkedIn, if available.employmentType– employment type label as shown by LinkedIn, if available.salary– parsed salary range, if LinkedIn shows one.currency– lowercase currency code, such asusd,eur, orgbp.minAmount– minimum amount in the range.maxAmount– maximum amount in the range.period– one ofyearly,monthly,hourly.
description– job description text, if available.applyUrl– Easy Apply or external application URL, if available.easyApply– whether the job uses LinkedIn Easy Apply.
Errors
jobNotFound– provided URL is not an existing LinkedIn job.