HeadHunter.ru API library (in process)
, (*1)
Provides a friendly API interface for HeadHunter (hh.ru) service., (*2)
Official API docs available here., (*3)
Dependencies
Requires PHP 5.6 or above., (*4)
Installation
The recommended way to install this library is via Composer.
New to Composer?, (*5)
composer require seregazhuk/headhunter-api
Quick Start
// You may need to amend this path to locate composer's autoloader
require('vendor/autoload.php');
use seregazhuk\HeadHunterApi\Api;
/**
* Token is optional. Your need token only
* for resources that require authentication
*/
$api = Api::create('YOUR_TOKEN');
$userInfo = $api->me->info();
You can create an instance without token, and later change it., (*6)
$api = Api::create();
$api->setToken('YOUR_TOKEN');
API Resources
Vacancies
View vacancy by id (official docs):, (*7)
$vacancy = $api->vacancies->view($id);
Get similar vacancies for the current one (official docs):, (*8)
$similarVacancies = $api->vacancies->similar($id);
Get black listed vacancies (official docs):, (*9)
$blacklisted = $api->vacancies->blacklisted();
Get list of favorited vacancies (official docs):, (*10)
$vacancies = $api->vacancies->favorited();
// with pagination
$vacancies = $api->vacancies->favorited(['page' => 2]);
Search (official docs):, (*11)
$vacancies = $api->vacancies->search($params);
Vacancy statistics (official docs):, (*12)
$stats = $api->vacancies->statistics($vacancyId);
Employer's active vacancies (official docs):, (*13)
$vacancies = $api->vacancies->active();
// you can specify a manager, by default uses current manager
$vacancies = $api->vacancies->active($managerId);
// with pagination
$vacancies = $api->vacancies->active($managerId, ['page'=>2]);
Employer's archived vacancies (official docs):, (*14)
$archived = $api->vacancies->archived();
// with pagination
$archived = $api->vacancies->archived(['page'=>2]);
Employer's hidden vacancies (official docs):, (*15)
$hidden = $api->vacancies->hidden();
// with pagination
$hidden = $api->vacancies->hidden(['page'=>2]);
Hide a vacancy (official docs):, (*16)
$api->vacancies->hide($vacancyId);
Restore a vacancy (official docs):, (*17)
$api->vacancies->restore($vacancyId);
Employers
View employee by id (official docs):, (*18)
$employee = $api->employers->view($id);
Search (official docs):, (*19)
$employers = $api->employers->search($params);
Employer Managers
Reference types and the rights of the manager (official docs):, (*20)
$reference_type = $api->employers->getManagerTypes();
$reference_type = $api->employers->getManagerTypes($employerId);
When used without parameters your employer id will be automatically resolved from your profile, (*21)
Get employer managers (official docs):, (*22)
$managers = $api->employers->getManagers();
$managers = $api->employers->getManagers($employerId);
$managerWhoHasVacancies = $api->employers->getManagersWhoHasVacancies();
$managerWhoHasVacancies = $api->employers->getManagersWhoHasVacancies($employerId);
When used without parameters your employer id will be automatically resolved from your profile, (*23)
Get manager information (official docs):, (*24)
$managers = $api->employers->getManager($managerId);
$managers = $api->employers->getManager($managerId, $employerId);
When used without parameters your employer id will be automatically resolved from your profile, (*25)
Artifacts:
Get your photos (official docs):, (*26)
$photos = $api->artifacts->photos();
Get your portfolio (official docs):, (*27)
$portfolio = $api->artifacts->portfolio();
Delete photo by id (official docs):, (*28)
$api->artifacts->deletePhoto($photoId);
Edit photo attributes (official docs):, (*29)
$api->artifacts->editPhoto($photoId, $attributes);
Upload photo (official docs):, (*30)
$api->artifacts->uploadPhoto('photo.jpg', 'my picture description');
Upload portfolio (official docs):, (*31)
$api->artifacts->uploadPortfolio('portfolio.jpg', 'my portfolio description');
User:
Get current user info (official docs):, (*32)
$info = $api->me->info();
Update name(last, first, middle). All parameters are required (official docs):, (*33)
$api->me->editName($lastName, $firstName, $middleName);
Update flag 'is_in_search' (official docs):, (*34)
$isInSearch = true; // or false;
$api->me->setIsInSearch($isInSearch);
Manager preferences by managerId. You can get your manager id from user object,
returned from $api->me->info()
. When used without parameters your manager id will be
automatically resolved from your profile (official docs)., (*35)
$me = $api->me->info();
$managerId = $me['manager']['id'];
$preferences = $api->manager->preferences($managerId);
// automatically get manager id from your profile
$preferences = $api->manager->preferences($managerId);
Get all comments about applicant (official docs):, (*36)
$comments = $api->comments->view($applicantId);
Create a comment (official docs).
You need an applicant id, to create a comment. Applicant id can be received from resume:, (*37)
$resumeInfo = $api->resume->view($resumeId);
$applicantCommentsUrl = $resumeInfo['owner']['comments']['url']; // https://api.hh.ru/applicant_comments/2743747
// You need to parse id from this url
// Create a comment, that is visible for coworkers
$result = $api->comments($applicantId, 'my comment');
// Create a comment, that is visible only for you
$result = $api->createPrivate($applicantId, 'my comment');
Edit comment (official docs):, (*38)
// Edit a comment, that is visible for coworkers
$api->comments->edit($applicantId, $commentId, 'new comment text')
// Edit a comment, that is visible only for you
$result = $api->editPrivate($applicantId, $commentId, 'new comment text');
Delete a comment (official docs):, (*39)
$api->comments->delete($applicantId, $commentId);
Industries
Get all industries (official docs):, (*40)
$industries = $api->industries->all();
Employee Negotiations
Get all negotiations (official docs):, (*41)
$negotiations = $api->negotiations->all();
Get only active negotiations (official docs):, (*42)
$negotiations = $api->negotiations->active();
View the list of messages., (*43)
- For employee: get messages of negotiation (official docs):
- For employer: view the list of messages in the response/invitation (official docs):
$api->negotiations->messages($negotiationId);
// with pagination
$api->negotiations->messages($negotiationId, ['page'=>2]);
Sending new message., (*44)
$api->negotiations->message($negotiationId, $messageText);
Git list of responses/invitation for (official docs):, (*45)
$responses = $api->negotiations->invited($vacancyId);
Response, (*46)
$responses = $api->negotiations->invitedResponses($vacancyId);
// with pagination
$responses = $api->negotiations->invitedResponses($vacancyId, ['page'=>2]);
Consider, (*47)
$toConsider = $api->negotiations->invitedConsider($vacancyId);
Phone interview, (*48)
$phoneInterviews = $api->negotiations->invitedPhoneInterviews($vacancyId);
Assessments, (*49)
$assessments = $api->negotiations->invitedAssessments($vacancyId);
Interviews, (*50)
$interviews = $api->negotiations->invitedInterviews($vacancyId);
Offers, (*51)
$offers = $api->negotiations->invitedOffers($vacancyId);
Hired, (*52)
$hired = $api->negotiations->invitedHired($vacancyId);
Discard by employer, (*53)
$discard = $api->negotiations->invitedDiscardByEmployer($vacancyId);
View the response/invitation by id. NegotiationId can be taken from key url in the invited
call response.
(official docs):, (*54)
$response = $api->negotiations->view($negotiationId);
Regions
Get all regions (official docs):, (*55)
$regions = $api->regions->all();
Resumes
Get my resumes (official docs):, (*56)
$resumes = $api->resumes->mine();
View resume (official docs):, (*57)
$views = $api->resumes->view($resumeId);
Edit resume (official docs):, (*58)
$api->resumes->edit($resumeId, ['first_name' => 'New name']);
Create a new resume (official docs):, (*59)
$attributes = ['first_name' => 'New name'];
$result = $api->resumes->create($attributes);
Views history (official docs):, (*60)
$views = $api->resumes->views($resumeId);
// with pagination
$views = $api->resumes->views($resumeId, ['page'=>2]);
Negotiations history (official docs):, (*61)
$negotiations = $api->resumes->negotiations($resumeId);
// with pagination
$negotiations = $api->resumes->negotiations($resumeId, ['page' => 2]);
Update resume publish date (official docs):, (*62)
$api->resumes->publish($resumeId);
Get resume conditions (official docs):, (*63)
$conditions = $api->resumes->conditions($resumeId);
Remove resume (official docs):, (*64)
$api->resumes->delete($resumeId);
Get current status (if it is blocked or ready to publish) (official docs):, (*65)
$status = $api->resumes->status($resumeId);
Get jobs recommendations for resume (official docs):, (*66)
$jobs = $api->resumes->jobs($resumeId)
// with pagination
$jobs = $api->resumes->jobs($resumeId, ['page' => 2])
Resume visibility
official docs, (*67)
Get resume black/white list:, (*68)
$blackList = $api->resumes->getBlackList($resumeId);
// ...
$whiteList = $api->resumes->getWhiteList($resumeId);
Add a company to black/white list:, (*69)
$api->resumes->addToBlackList($resumeId, $companyId);
// ...
$api->resumes->addToWhiteList($resumeId, $companyId);
Remove a company from black/white list:, (*70)
$api->resumes->removeFromBlackList($resumeId, $companyId);
// ...
$api->resumes->removeFromWhiteList($resumeId, $companyId);
Clear black/white list:, (*71)
$api->resumes->clearBlackList($resumeId);
// ...
$api->resumes->clearWhiteList($resumeId);
Search in black/white list:, (*72)
$companies = $api->resumes->searchInBlackList($resumeId, 'some-key-word');
//...
$companies = $api->resumes->searchInWhiteList($resumeId, 'some-key-word');
Search in black/white list:, (*73)
Saved searches:
List searches (official docs):, (*74)
$searches = $api->savedSearches->all();
Get one search (official docs):, (*75)
$searches = $api->savedSearches->view($searchId);
Specializations
Get all specializations (official docs):, (*76)
$specializations = $api->specializations->all();
Dictionaries
Get list of entities that are used in API (official docs):, (*77)
$dictionaries = $api->dictionaries->all();
Suggests
Educational institutions (official docs):, (*78)
$suggests = $api->suggests->educational_institutions($text);
Companies (official docs):, (*79)
$suggests = $api->suggests->companies($text);
Specialization (official docs):, (*80)
$suggests = $api->suggests->fieldsOfStudy($text);
Key skills (official docs):, (*81)
$suggests = $api->suggests->skillSet($text);
Position (official docs):, (*82)
$suggests = $api->suggests->positions($text);
Region (official docs):, (*83)
$suggests = $api->suggests->areas($text);
Tips for vacancy search key words (official docs):, (*84)
$suggests = $api->suggests->vacancySearchKeyword($text);
Metro
Obtaining all metro stations of all cities (official docs):, (*85)
$stations = $api->metro->all();
List of metro stations and lines in a specific city (official docs):, (*86)
$stations = $api->metro->forCity($cityId);
Languages
Obtaining available languages (official docs):, (*87)
$languages = $api->languages->all();
Faculties
Get list of faculties of the educational institutions (official docs).
Uses institutionId that can be obtained from the suggestions for educational institutions., (*88)
$faculties = $api->faculties->forInstitution($institutionId);
Locale
You can set a locale for your requests, the results will be returned in the selected locale. RU
is set by
default (official docs):, (*89)
$api->setLocale('EN');
// chain methods
$api->setLocale('EN')
->me
->info();
Host
Get data from different websites of the HeadHunter group.
(official docs):, (*90)
$api->setHost('hh.kz');
// chain methods
$api->setHost('hh.kz')
->me
->info();