Authentication overview
The Adzuna API utilizes a straightforward API key authentication mechanism to control access to its job data endpoints. This method requires developers to include two distinct credentials—an Application ID and an Application Key—with every API request. These keys act as a unique identifier for your application and a secret token, respectively, ensuring that only authorized applications can retrieve data from Adzuna's extensive job database. This approach simplifies integration while maintaining a necessary level of access control for the Adzuna Job Search API reference.
When making calls to endpoints such as the Job Search API, Job Salary API, or Job Trends API, the Application ID and Application Key must be passed as query parameters. This standardization across all API products ensures consistent authentication behavior for developers integrating Adzuna's capabilities into their applications, career portals, or market research tools. The Adzuna developer portal provides detailed instructions and code examples in multiple languages, including Python, Ruby, PHP, Java, Node.js, and C#, to facilitate this process, as noted in the Adzuna developer experience documentation.
Supported authentication methods
Adzuna's API primarily supports API key authentication. This method is common for RESTful APIs due to its simplicity and ease of implementation. While suitable for many applications, understanding its security implications is crucial. API keys are generally considered less secure than token-based systems like OAuth 2.0, which provide granular permissions and refresh mechanisms, as detailed in the OAuth 2.0 specification. However, for Adzuna's specific use case of providing read-only access to job data, API keys offer a practical balance of security and usability.
The following table outlines the supported authentication method, its typical use cases, and general security considerations:
| Method | When to Use | Security Level |
|---|---|---|
| API Key (Application ID & Key) | Accessing public or semi-public data; server-side applications where keys can be securely stored. | Moderate (requires careful handling to prevent exposure) |
Adzuna does not currently support more complex authentication flows such as OAuth 2.0 or mutual TLS for its public API. Developers should design their applications to protect their API keys diligently, especially when integrating Adzuna data into client-side applications where direct exposure is a higher risk. Best practices for securing API keys are discussed in more detail in the Google Cloud API key best practices guide, which offers general guidance applicable to any API key implementation.
Getting your credentials
To begin using the Adzuna API, you must first obtain your unique Application ID and Application Key. These credentials are provided through the Adzuna developer portal. The process involves registering for a developer account and creating an application, which will then generate the necessary keys for authentication.
- Register for a Developer Account: Navigate to the Adzuna developer website and sign up for an account. This typically requires an email address and password.
- Access Your Dashboard: Once registered and logged in, you will be directed to your developer dashboard.
- Create a New Application: Look for an option to 'Create New Application' or similar. You may need to provide a name for your application and a brief description of its intended use.
- Retrieve API Keys: Upon successful application creation, your unique Application ID and Application Key will be displayed. It is crucial to copy and store these keys securely immediately, as the Application Key may not be viewable again after initial generation for security reasons.
- Understand Usage Limits: Adzuna offers a free tier of 5,000 requests per month. Exceeding this limit will require upgrading to a paid plan, starting at $50/month for 20,000 requests, as detailed on the Adzuna pricing page. Your API keys will be linked to your chosen plan and usage limits.
These credentials are tied to your developer account and track your API usage against your allocated request limits. They are essential for all interactions with the Adzuna API, from basic job searches to more advanced salary and trend analysis.
Authenticated request example
Once you have obtained your Application ID and Application Key, you can integrate them into your API requests. The keys are passed as query parameters named app_id and app_key, respectively. Below is a conceptual example of an authenticated request to the Adzuna Job Search API for jobs in London related to 'software engineer'.
GET https://api.adzuna.com/v1/api/jobs/gb/search/1?
app_id=YOUR_APP_ID
&app_key=YOUR_APP_KEY
&results_per_page=10
&what=software%20engineer
&where=london
&content-type=application/json
Replace YOUR_APP_ID and YOUR_APP_KEY with your actual credentials. The what and where parameters specify the search criteria, and results_per_page limits the number of results returned. This structure applies consistently across different Adzuna API endpoints, ensuring a uniform authentication experience for all developers.
Here is a Python example demonstrating how to make an authenticated request using the requests library:
import requests
APP_ID = "YOUR_APP_ID"
APP_KEY = "YOUR_APP_KEY"
base_url = "https://api.adzuna.com/v1/api/jobs/gb/search/1"
params = {
"app_id": APP_ID,
"app_key": APP_KEY,
"results_per_page": 10,
"what": "software engineer",
"where": "london",
"content-type": "application/json"
}
try:
response = requests.get(base_url, params=params)
response.raise_for_status() # Raise an exception for HTTP errors
data = response.json()
print(data)
except requests.exceptions.RequestException as e:
print(f"An error occurred: {e}")
This example illustrates how to construct the request URL with the necessary query parameters in a programming language, ensuring proper authentication for the Adzuna API. Further examples in other languages are available in the Adzuna API reference documentation.
Security best practices
Securing your Adzuna API credentials is paramount to prevent unauthorized access to your account and maintain the integrity of your application. Adhering to robust security practices helps protect your usage limits and sensitive data.
- Never hardcode API keys: Avoid embedding your Application ID and Application Key directly within your application's source code. This practice risks exposure if your code repository is compromised or publicly accessible.
- Use environment variables: Store API keys as environment variables on your server or development machine. This keeps them separate from your codebase and allows for easier management and rotation.
- Utilize secret management services: For production deployments, consider using dedicated secret management services like AWS Secrets Manager, Google Secret Manager, or Azure Key Vault. These services provide secure storage, retrieval, and rotation of sensitive credentials.
- Restrict access to keys: Limit access to your API keys to only those individuals and systems that require them. Implement strict access controls on any system where keys are stored.
- Do not expose keys in client-side code: Never include your API keys directly in client-side code (e.g., JavaScript in a web browser or mobile application). This would expose them to end-users, who could then misuse them. All API calls requiring authentication should originate from your secure backend server.
- Encrypt data in transit: Always use HTTPS for all API requests to Adzuna. This ensures that your API keys and the data exchanged are encrypted during transmission, protecting against eavesdropping and man-in-the-middle attacks. Adzuna's API endpoints are served over HTTPS by default, as is standard practice for secure web APIs, in line with HTTP/1.1 message syntax requirements for secure communication.
- Monitor API usage: Regularly review your API usage statistics within your Adzuna developer dashboard. Unusual spikes in requests could indicate unauthorized use of your keys.
- Implement rate limiting and error handling: While Adzuna manages its own rate limits, implementing client-side rate limiting and robust error handling in your application can help manage unexpected usage and prevent your application from being flagged for suspicious activity.
- Key rotation: Periodically rotate your API keys. If a key is compromised, rotating it minimizes the window of vulnerability. Check the Adzuna developer portal for options to regenerate your keys.
By following these best practices, developers can significantly enhance the security posture of their applications when integrating with the Adzuna API and protect their credentials from potential threats.