SDKs overview

Software Development Kits (SDKs) and libraries for WhatJobs offer developers pre-packaged functionalities to interact with the WhatJobs API. These tools simplify common tasks such as searching for job listings, posting new jobs, and managing applicant data, by abstracting the underlying HTTP requests, data parsing, and authentication mechanisms.

Integrating with the WhatJobs platform through an SDK typically involves installing a package in your preferred programming language, initializing a client with your API credentials (either an API Key or OAuth 2.0 tokens), and then calling specific methods to perform operations. This approach reduces the boilerplate code developers need to write, accelerating development cycles and minimizing potential errors associated with direct API calls. The official SDKs are designed to maintain compatibility with the latest API versions and best practices, ensuring reliable interactions with the WhatJobs service.

Official SDKs by language

WhatJobs provides official SDKs for several popular programming languages, designed to offer stable and supported methods for integrating with its platform. These SDKs are maintained by WhatJobs to ensure compatibility with API updates and to provide a consistent development experience. Each SDK encapsulates the logic for authenticating, making requests, and handling responses from the WhatJobs API, following language-specific conventions.

The table below lists the primary official SDKs, their respective package names for installation, the typical install command, and their general maturity level. Details regarding specific versioning and detailed API references are available within the official WhatJobs developer documentation.

Language Package Name Install Command Maturity
Python whatjobs-python pip install whatjobs-python Stable
JavaScript (Node.js) @whatjobs/js-sdk npm install @whatjobs/js-sdk Stable
Ruby whatjobs-ruby gem install whatjobs-ruby Stable
PHP whatjobs/php-sdk composer require whatjobs/php-sdk Stable

Each SDK is distributed through its language's standard package manager, ensuring ease of installation and dependency management. Developers can refer to language-specific guides on the WhatJobs Python SDK documentation for more specific usage patterns and examples beyond the quickstart.

Installation

Installing a WhatJobs SDK typically involves using the standard package manager for your chosen programming language. The process is designed to be straightforward, allowing developers to quickly add the necessary libraries to their projects. Ensure you have the respective package manager (e.g., pip for Python, npm for Node.js, gem for Ruby, composer for PHP) installed and configured in your development environment.

Python SDK Installation

To install the Python SDK, open your terminal or command prompt and execute the following command:

pip install whatjobs-python

This command downloads the whatjobs-python package and its dependencies from PyPI (Python Package Index) to your Python environment. You can verify the installation by attempting to import the library in a Python interpreter.

JavaScript (Node.js) SDK Installation

For Node.js projects, navigate to your project directory in the terminal and run:

npm install @whatjobs/js-sdk

This adds the @whatjobs/js-sdk package to your node_modules folder and updates your package.json file. If you are using Yarn instead of npm, the command would be yarn add @whatjobs/js-sdk.

Ruby SDK Installation

To install the Ruby SDK, use the RubyGems package manager:

gem install whatjobs-ruby

This command fetches the whatjobs-ruby gem from RubyGems.org and makes it available for use in your Ruby applications.

PHP SDK Installation

For PHP projects, Composer is the standard for dependency management. In your project's root directory, run:

composer require whatjobs/php-sdk

Composer will download the PHP SDK and its dependencies, and generate an autoloader file, which you will include in your project. More detailed instructions for each language, including prerequisites and version compatibility, can be found in the WhatJobs SDK installation guides.

Quickstart example

This quickstart example demonstrates how to use the WhatJobs Python SDK to perform a basic job search. This example assumes you have already installed the whatjobs-python package and have a valid WhatJobs API key.

Python Quickstart: Searching for Jobs

First, ensure you have your API key ready. You can typically find your API key in your WhatJobs developer dashboard after signing up for a developer account. It is recommended to store your API key securely, for example, as an environment variable, rather than hardcoding it directly into your source code. An example of secure API key management can be found in the Google Cloud API key best practices.


import os
from whatjobs_python import Client
from whatjobs_python.exceptions import WhatJobsException

# It's recommended to store your API key as an environment variable
api_key = os.environ.get("WHATJOBS_API_KEY")

# Initialize the WhatJobs client
try:
    client = Client(api_key=api_key)
except WhatJobsException as e:
    print(f"Error initializing client: {e}")
    exit()

# Define your search parameters
search_params = {
    "keywords": "Software Engineer",
    "location": "London, UK",
    "radius": 25, # miles
    "page": 1,
    "limit": 10
}

# Perform the job search
try:
    response = client.jobs.search(**search_params)

    print(f"Found {response.total_results} jobs.")
    for job in response.jobs:
        print(f"- {job.title} at {job.company_name} ({job.location})")
        print(f"  URL: {job.job_url}")

    # Access pagination information
    print(f"Current page: {response.current_page}")
    print(f"Total pages: {response.total_pages}")

except WhatJobsException as e:
    print(f"Error performing job search: {e}")
except Exception as e:
    print(f"An unexpected error occurred: {e}")

This script first imports the necessary components from the installed SDK. It then attempts to initialize the client with an API key retrieved from an environment variable. After setting up search parameters like keywords, location, and radius, it calls the client.jobs.search method to retrieve job listings. The results are then iterated and printed, showing the job title, company, location, and a direct URL to the job posting. Error handling is included to catch potential issues during client initialization or the search process.

Community libraries

While WhatJobs provides official SDKs, the developer community often contributes additional libraries, tools, and integrations that extend functionality or provide support for languages not officially covered. These community-driven projects can offer alternative approaches, specialized features, or integrations with other popular frameworks and services.

Community libraries are typically hosted on platforms like GitHub and distributed through language-specific package managers. Their quality, maintenance, and feature sets can vary significantly compared to official SDKs. Developers are encouraged to evaluate community libraries based on factors such as:

  • Active Development: Check the project's commit history and issue tracker for recent activity.
  • Documentation: Assess the clarity and completeness of the available documentation.
  • Community Support: Look for an active community (e.g., GitHub discussions, forums) that can provide assistance.
  • Features: Verify if the library supports the specific WhatJobs API endpoints and features you require.
  • License: Understand the licensing terms under which the library is distributed.

Examples of potential community contributions might include:

  • WhatJobs-Go: A Go (Golang) client library for WhatJobs API interactions.
  • WhatJobs-Java: A Java SDK to integrate WhatJobs services into Java applications.
  • WhatJobs-Laravel-Package: A PHP package specifically designed for Laravel framework users to simplify WhatJobs API integration.
  • WhatJobs-CLI: A command-line interface tool for quick interactions with the WhatJobs API without writing code.

To discover community libraries, developers can search relevant package repositories (e.g., PyPI, npm, RubyGems, Packagist) or explore GitHub for repositories tagged with "whatjobs" or "whatjobs-api". The WhatJobs developer community page may also list notable community projects or provide guidelines for contributing your own. Always review the source code and usage patterns of any third-party library before integrating it into a production environment, as advised in general software development security practices.