Installation
Download Careerjet_API.zip and unzip it in a location where your scripts will find it.
cd my_application_directory
wget http://www.careerjet.co.uk/partners/api/php/Careerjet_API.zip
unzip Careerjet_API.zip
Documentation
For full details please refer to the documentation in the Careerjet_API.php script contained within the .zip archive.
Important notes:
- the fields
searchandlocationare optional but are limited to your country
Example code
require Careerjet_API;
$api_key = '<API_KEY>';
$locale_code = 'en_IM';
$search_api = new Careerjet_API($locale_code, $api_key);
$result = $search_api->search([
'keywords' => 'php developer',
'location' => 'London',
'page' => 1,
'sort' => 'relevance', # salary, date, or relevance
]);
if ($result->type == 'JOBS') {
echo "Found " . $result->hits . " jobs on " . $result->pages . " pages\n";
$jobs = $result->jobs;
foreach( $jobs as $job ){
echo " URL: ".$job->url."\n";
echo " TITLE: ".$job->title."\n";
echo " LOC: ".$job->locations."\n";
echo " COMPANY: ".$job->company."\n";
echo " SALARY: ".$job->salary."\n";
echo " DATE: ".$job->date."\n";
echo " DESC: ".$job->description."\n";
echo "\n" ;
}
}
# when several locations match the input location
# a new search needs to be done with one of the proposed locations
if ($result->type == 'LOCATIONS') {
foreach ($result->locations as $loc) {
echo $loc->name."\n";
}
}