https://github.com/mahmoud-anani/address-ip
An application to retrieve the IP address of the site user and retrieve his current data
https://github.com/mahmoud-anani/address-ip
address html http ip rest-api
Last synced: about 1 month ago
JSON representation
An application to retrieve the IP address of the site user and retrieve his current data
- Host: GitHub
- URL: https://github.com/mahmoud-anani/address-ip
- Owner: Mahmoud-Anani
- Created: 2024-08-24T10:40:39.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-24T10:43:23.000Z (about 1 year ago)
- Last Synced: 2025-02-26T06:20:29.863Z (8 months ago)
- Topics: address, html, http, ip, rest-api
- Language: HTML
- Homepage: https://address-ip-swart.vercel.app
- Size: 1000 Bytes
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Get Data on Address IP
This is a simple HTML project that fetches and displays the user's public IP address and related geolocation data using the `ipify` and `ipapi` APIs.
## Features
- **Fetch Public IP**: The application retrieves the user's public IP address.
- **Display Geolocation Data**: It fetches and displays additional geolocation data related to the IP address, including country, region, city, and more.## How It Works
1. The script starts by displaying "loading..." while the data is being fetched.
2. It fetches the public IP address using the `ipify` API.
3. Once the IP address is retrieved, it fetches additional data related to that IP using the `ipapi` API.
4. The IP address is displayed in the `` element, and the geolocation data is formatted and displayed in a `
` element.## Technologies Used
- **HTML**: For the basic structure of the page.
- **JavaScript**: For fetching the IP address and geolocation data from external APIs.
- **APIs Used**:
- [ipify](https://www.ipify.org/): To get the public IP address.
- [ipapi](https://ipapi.co/): To get geolocation data based on the IP address.## How to Use
1. Clone the repository or download the HTML file.
2. Open the HTML file in any web browser.
3. The page will automatically display your public IP address and related geolocation data.## Example Output
```json
{
"ip": "123.456.78.9",
"city": "Sample City",
"region": "Sample Region",
"country": "Sample Country",
"postal": "12345",
"latitude": 12.345678,
"longitude": -12.345678,
"timezone": "Sample/Timezone",
"org": "Sample Organization"
}