Authentication overview

GeoScore secures access to its API endpoints primarily through API key authentication. This method requires client applications to include a unique API key with each request, allowing the GeoScore platform to verify the identity of the requester and authorize access to specific features and data. The API key serves as a token that links requests to your GeoScore account, enabling usage tracking and adherence to rate limits and subscription tiers.

API keys are a common authentication mechanism for web APIs due to their simplicity and ease of implementation for developers. They function as a secret token, and their security relies heavily on keeping the key confidential and transmitting it over secure channels. GeoScore enforces HTTPS/TLS for all API communications, encrypting data in transit and protecting API keys from interception during transmission, which aligns with industry best practices for securing API communication as outlined by the W3C Web Security guidelines.

Developers interacting with GeoScore's API will integrate their API key into request headers or query parameters, depending on the specific endpoint requirements detailed in the GeoScore API reference documentation. Proper management of these keys, including secure storage and regular rotation, is crucial for maintaining the integrity and security of your applications and data.

Supported authentication methods

GeoScore currently supports a single, streamlined authentication method: API key authentication. This method is suitable for most integration scenarios, from server-side applications to client-side frameworks, provided the key is handled securely.

Method When to Use Security Level
API Key All GeoScore API interactions (server-side, backend services) Moderate (dependent on secure storage and transmission)

While API keys are straightforward, it's important to understand their limitations compared to more complex protocols like OAuth 2.0. API keys grant broad access to the associated account's resources, so their compromise can lead to unauthorized data access or malicious usage. Unlike OAuth 2.0, which allows for delegated authorization and token expiration, API keys typically do not have built-in expiration unless manually revoked. For a deeper understanding of API security protocols, resources like the OAuth 2.0 specification provide extensive details on alternative approaches.

Getting your credentials

To obtain your GeoScore API key, follow these steps:

  1. Sign Up or Log In: Navigate to the GeoScore homepage and either create a new account or log in to an existing one. A free plan is available, offering 1000 API calls per month, which is sufficient for initial testing and development.
  2. Access Dashboard: Once logged in, access your GeoScore user dashboard. This is typically where account management, usage statistics, and API key generation are handled.
  3. Generate API Key: Look for a section labeled "API Keys," "Developer Settings," or similar. Within this section, you should find an option to generate a new API key. GeoScore's documentation provides specific instructions on how to generate your first API key.
  4. Copy Your Key: After generation, your unique API key will be displayed. Copy this key immediately and store it securely. For security reasons, GeoScore may only display the key once, and you might not be able to retrieve it again if lost. If lost, you would typically need to revoke the old key and generate a new one.
  5. Configure Your Application: Integrate the copied API key into your application's configuration, ensuring it is loaded securely and not hardcoded directly into publicly accessible client-side code.

Authenticated request example

Once you have obtained your API key, you can include it in your API requests. GeoScore primarily expects the API key to be passed as a custom HTTP header named X-API-Key. Here's an example using curl to call a hypothetical GeoScore endpoint:

curl -X GET \
  'https://api.geoscore.io/v1/sentiment?location=Eiffel%20Tower&radius=500' \
  -H 'X-API-Key: YOUR_GEO_SCORE_API_KEY' \
  -H 'Content-Type: application/json'

In this example:

  • YOUR_GEO_SCORE_API_KEY should be replaced with the actual API key you generated from your GeoScore dashboard.
  • The X-API-Key header is used to transmit your credentials securely.
  • The request targets a hypothetical /v1/sentiment endpoint, querying sentiment data for a specific location.

For integrations using programming languages like Python or Node.js, the process involves setting the header within your HTTP client library. The GeoScore developer documentation provides code examples for various languages, including Python and Node.js, to help you integrate quickly.

Security best practices

Securing your GeoScore API keys is paramount to prevent unauthorized access to your account and data. Adhering to these best practices will help maintain the integrity of your integrations:

  1. Never Expose API Keys in Client-Side Code: Do not embed your API key directly in client-side code (e.g., JavaScript in a web browser, mobile app bundles). If exposed, it can be easily extracted and misused. All API calls requiring your secret key should originate from your secure backend server.
  2. Use Environment Variables or Secret Management Services: Store your API keys in environment variables on your server or use a dedicated secret management service (e.g., AWS Secrets Manager, Google Secret Manager, Azure Key Vault). This prevents keys from being committed to version control systems and provides a centralized, secure way to manage them. For cloud-native deployments, refer to AWS Secrets Manager documentation for guidance on secure secret storage.
  3. Enforce HTTPS/TLS: GeoScore enforces HTTPS for all API communications, ensuring that your API key and data are encrypted during transit. Always verify that your application is communicating over HTTPS to prevent man-in-the-middle attacks.
  4. Implement IP Whitelisting (if available): If GeoScore offers IP whitelisting, configure it to restrict API key usage to a specific set of trusted IP addresses belonging to your servers. This adds an extra layer of security, as even if a key is compromised, it can only be used from approved locations.
  5. Regularly Rotate API Keys: Periodically generate new API keys and revoke old ones. This practice limits the window of exposure for any potentially compromised keys. The frequency of rotation should align with your organization's security policies.
  6. Monitor API Usage: Regularly review your API usage statistics within the GeoScore dashboard. Unusual spikes in activity or requests from unexpected locations could indicate a compromised key.
  7. Implement Rate Limiting and Error Handling: While GeoScore has its own rate limits, implementing client-side rate limiting and robust error handling can help prevent abuse and provide graceful degradation in case of unexpected issues or unauthorized access attempts.

By diligently following these security measures, developers can significantly reduce the risk associated with API key authentication and ensure the secure operation of their GeoScore integrations.