Authentication overview

Authentication for HelloSalut APIs is a prerequisite for accessing its geospatial services, which include Geocoding, Reverse Geocoding, Timezone, and IP Geolocation capabilities. The primary mechanism for verifying client identity and authorizing API requests is the use of API keys. This method provides a straightforward way to manage access control for applications consuming HelloSalut's location data. Each API key is linked to a specific HelloSalut account, enabling the platform to track usage, apply rate limits, and enforce subscription tiers as outlined in the HelloSalut pricing structure. All communication with HelloSalut APIs, including the transmission of API keys, is secured using HTTPS/TLS to protect data integrity and confidentiality during transit.

The system is designed to be developer-friendly, offering clear documentation and code examples across multiple programming languages, simplifying the integration of authentication mechanisms into diverse applications. Developers can find comprehensive details on how to use their API keys within the HelloSalut API reference documentation.

Supported authentication methods

HelloSalut primarily supports API key authentication. This method involves generating a unique alphanumeric string within the user's account dashboard and including it with every API request. While simple to implement, proper management of API keys is crucial for maintaining application security.

Method When to Use Security Level
API Key (Query Parameter) For server-side applications, client-side applications where keys are restricted (e.g., domain whitelisting), and general API access. Moderate (requires secure storage and transmission via HTTPS; vulnerable if exposed in public code/repositories).

Clients are expected to transmit their API key as a query parameter in their request URLs. For example, a request might look like https://api.hellosalut.com/v1/geocode?q=Paris&key=YOUR_API_KEY. It is critical to ensure that these requests are always made over HTTPS to prevent the API key from being intercepted in transit. The use of HTTPS is a standard practice for protecting data exchanged over a network, as detailed in Google Cloud's Transport Layer Security (TLS) overview. HelloSalut's SDKs for JavaScript, Python, PHP, and Ruby handle the proper inclusion of the API key in requests, abstracting some of the implementation details from the developer.

Getting your credentials

To begin using HelloSalut APIs, you must first obtain an API key. This process involves registering for an account on the HelloSalut website and generating the key through your user dashboard.

  1. Sign Up/Log In: Navigate to the HelloSalut homepage and either create a new account or log in to an existing one.
  2. Access Dashboard: Once logged in, locate and access your personal dashboard or account settings area.
  3. Generate API Key: Look for a section typically labeled "API Keys," "Credentials," or "Developers." Within this section, there should be an option to generate a new API key.
  4. Copy Your Key: After generation, your unique API key will be displayed. Copy this key immediately and store it securely. HelloSalut generally does not display the full key again for security reasons, so it is essential to save it upon creation.
  5. Configure Restrictions (Optional but Recommended): Some API key management interfaces allow you to add restrictions to your key, such as IP address whitelisting or HTTP referrer restrictions. While HelloSalut's documentation does not explicitly detail these options, it is a common security practice for API providers. Refer to the official HelloSalut documentation for any available configuration options.

HelloSalut offers a free tier that includes 5,000 requests per month, allowing developers to test and integrate the API before requiring a paid subscription. Your API key will be valid for both free and paid usage, with usage limits applied based on your current plan.

Authenticated request example

Making an authenticated request to HelloSalut APIs involves appending your API key to the request URL. The following examples demonstrate how to do this using common programming languages supported by HelloSalut's SDKs.

Python Example

Using the requests library for a simple GET request:


import requests

API_KEY = "YOUR_HELLOSALUT_API_KEY"
query = "Eiffel Tower, Paris"

url = f"https://api.hellosalut.com/v1/geocode?q={query}&key={API_KEY}"

try:
    response = requests.get(url)
    response.raise_for_status()  # Raise an exception for HTTP errors
    data = response.json()
    print("Geocoding Results:")
    print(data)
except requests.exceptions.HTTPError as err:
    print(f"HTTP error occurred: {err}")
except Exception as err:
    print(f"An error occurred: {err}")

JavaScript Example (Browser)

Using the fetch API for a client-side request:


const API_KEY = "YOUR_HELLOSALUT_API_KEY";
const query = "London, UK";

const url = `https://api.hellosalut.com/v1/geocode?q=${query}&key=${API_KEY}`;

fetch(url)
  .then(response => {
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    return response.json();
  })
  .then(data => {
    console.log("Geocoding Results:", data);
  })
  .catch(error => {
    console.error("Error fetching geocoding data:", error);
  });

When implementing these examples, replace "YOUR_HELLOSALUT_API_KEY" with the actual key obtained from your HelloSalut dashboard. These examples illustrate direct API key inclusion, which is suitable for server-side applications or controlled client-side environments where the key is protected.

Security best practices

Securing your API keys and calls to HelloSalut is crucial to prevent unauthorized access, protect your account from exceeding rate limits, and ensure the integrity of your application. Adhering to the following best practices will help maintain a secure integration:

  • Keep API Keys Confidential: Never hardcode API keys directly into client-side code that will be publicly accessible (e.g., JavaScript in a web browser). For client-side applications, consider using a backend proxy server to make requests to HelloSalut, thus keeping your API key on the server side.
  • Use Environment Variables for Server-Side Keys: In server-side applications, store your API keys as environment variables rather than directly in your source code. This practice prevents the key from being committed to version control systems like Git, enhancing security. Details on managing environment variables are available from resources like AWS Lambda's environment variable documentation.
  • Restrict API Key Usage (if available): If HelloSalut's dashboard provides options to restrict API keys by IP address, HTTP referrer, or domain, configure these restrictions. This limits the key's usability to only your authorized application environments.
  • Employ HTTPS/TLS: Always ensure all requests to HelloSalut APIs are made over HTTPS. This encrypts the communication channel, protecting your API key and data from interception during transmission. HelloSalut's API endpoints are designed to enforce HTTPS exclusively.
  • Regularly Rotate API Keys: Periodically generate new API keys and revoke old ones. This practice reduces the window of exposure if a key is ever compromised.
  • Monitor API Usage: Regularly check your HelloSalut dashboard for unusual API usage patterns. Spikes in requests could indicate a compromised key or an issue with your application, potentially leading to unexpected charges or service interruptions.
  • Implement Server-Side Validation: For any user-submitted data that will be used in HelloSalut API requests (e.g., user-entered addresses for geocoding), always perform server-side validation to prevent injection attacks or malformed requests.

By diligently following these security guidelines, developers can significantly reduce the risk of API key compromise and ensure the secure operation of their applications integrated with HelloSalut's geospatial services.