PHP Job Searching using Zip-Recruiter API

in #utopian-io7 years ago (edited)

Introduction

The ZipRecruiter Search API enables our search Publisher partners to write software that works with ZipRecruiter’s elevated search product and display the best job search matches to job seekers on their site.

The ZipRecruiter Search API is a REST-ful API with all requests and responses sent over HTTPS and authenticated by the ‘api_key’ URL parameter. All API responses are returned with HTTP response codes used to denote success (2xx), client-caused failure (4xx), and server-caused failure (5xx). Responses are formatted as JSON.

This PHP library wraps the ZipRecruiter Search API and allows you to do some advanced job searches.

How to Use?

First, require the unit class.ziprecruiter.php and you can create the ZipRecruiter object by passing the APP_KEY.

$key = "APP_KEY";
$zip = new ZipRecruiter($key);

Then you can search the jobs by giving the paramter job name, location and job age to the Search method:

$zip->Search("Software Engineer", "London, UK", 25);

You then need to check if results are valid by method CheckResult. After that, you can filter the jobs by salary range FilterJobsBySalaryRange or industry FilterJobsByIndustry

Technology Stack

PHP 7.0 and composer unit test framework.

Demo

<?php
$key = "APP_KEY";
$zip = new ZipRecruiter($key);
$zip->Search("Software Engineer", "London, UK", 25);

if ($zip->CheckResult()) {
  echo "Total Jobs: " . $zip->GetTotalJobs(). "\n";
  $jobs = $zip->FilterJobsBySalaryRange(55000, 75000);
  foreach ($jobs as $job) {
    echo "Job ID: " . $job->id . "\n";
    echo "Company: " . $job->hiring_company->name . "\n";
    echo "Salary Min Annual: " . $job->salary_min_annual . "\n";
    echo "Salary Max Annual: " . $job->salary_max_annual . "\n";
    echo "Job URL: " . $job->url . "\n";
    echo "Published: " . $job->job_age . " days ago.\n";
  }  
  echo count($jobs);
  $jobs = $zip->FilterJobsByIndustry("Technology", $jobs);
  echo "Total Technology jobs: " . count($jobs);
}

Unit Tests

Unit tests are coming on the way... built on composer

Live Example

The above sample has been integrated live: https://helloacm.com/software-engineering-jobs/ and this post has been reposted to my blog: https://helloacm.com/php-job-searching-using-zip-recruiter-api/

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

Github: https://github.com/DoctorLai/ZipRecruiter



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

this is a guide for me because I am a job sicker.

Wow, that's great news! 👏🏼👏🏼👏🏼

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

wowwww.. great work dear....

Hey @justyy I am @utopian-io. I have just upvoted you!

Achievements

  • WOW WOW WOW People loved what you did here. GREAT JOB!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.17
TRX 0.16
JST 0.029
BTC 75924.44
ETH 2901.21
USDT 1.00
SBD 2.67