Skip to content

Add Geolocation API for IP Metadata #14

Description

@Ricky-G

Description

Enhance the existing API by adding a geolocation feature. This new API endpoint should provide detailed metadata about the IP address, including:

  • Country Name: The country where the IP is located.
  • Geolocation: Latitude and longitude of the IP address.
  • ISP Information: The Internet Service Provider associated with the IP.
  • Additional Metadata: Any other relevant geolocation details.

Requirements

  1. Introduce a new endpoint, e.g., /api/ip/geolocation.
  2. Integrate with a reliable geolocation service provider (e.g., MaxMind, IP2Location, or similar).
  3. Ensure the response format is consistent with the existing API structure.
  4. Add configuration options for enabling/disabling geolocation features.
  5. Update the OpenAPI specification (api-spec.yml) to include the new endpoint.
  6. Include unit tests and integration tests for the new functionality.
  7. Document the new endpoint in the README.md under API Endpoints.

Example Response

{
  "ipVersion": 6,
  "ipAddress": "2401:7000:ca38:f900:58a:3cfb:a34a:ce04",
  "latitude": -36.8486,
  "longitude": 174.754,
  "countryName": "New Zealand",
  "countryCode": "NZ",
  "capital": "Wellington",
  "phoneCodes": [
    64
  ],
  "timeZones": [
    "Pacific/Auckland",
    "Pacific/Chatham"
  ],
  "cityName": "Auckland (Auckland CBD)",
  "regionName": "Auckland",
  "continent": "Oceania",
  "continentCode": "OC",
  "currencies": [
    "NZD"
  ],
  "languages": [
    "en",
    "mi"
  ],
  "asn": "45177",
  "asnOrganization": "Devoli LTD"
}

Additional Notes

  • Ensure the implementation is efficient and can handle high-throughput scenarios.
  • Consider privacy implications and provide options to anonymize sensitive data if required.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions