Skip to content

Commit 2f45d33

Browse files
API Introduction, system requirements, basic usage
1 parent d52e6b6 commit 2f45d33

1 file changed

Lines changed: 25 additions & 8 deletions

File tree

README.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,44 @@
1-
# IP Geolocation API PHP SDK
2-
You need a valid IPGeolocation API key to use this SDK. [Sign up](https://ipgeolocation.io/signup) here, if you don’t have the API key.
1+
# IP Geolocation API Typescript SDK
2+
3+
## Introduction
4+
IPGeolocation API is the solution to identify country code (ISO2 and ISO3 standard), country name, continent code, continent name, country capital, state/province, district, city, zip code, latitude and longitude of city, is country belongs to Europian Union, calling code, top level domain (TLD), languages, country flag, internet service provider (ISP), connection type, organization, geoname ID, currency code, currency name, time zone ID, time zone offset, current time in the time zone, is time zone in daylight saving time, and total daylight savings. This document provides important information to help you get up to speed with IPGeolocation API using IP Geolocation API PHP SDK.
5+
6+
Developers can use this Typescript SDK for software and web projects related to, but not limited to:
7+
8+
* Display native language and currency
9+
* Redirect based on the country
10+
* Digital rights management
11+
* Web log stats and analysis
12+
* Auto-selection of country, state/province and city on forms
13+
* Filter access from countries you do not do business with
14+
* Geo-targeting for increased sales and click-through
315

416
## Quick Start Guide
5-
Call method **get_location($apikey, $clientIp)** passing *API key* and *IP address (optional)* as parameters and it will return IPGeolocation API response.
6-
Note: If you want IP to geolocation for machine calling IPGeolocation API, don't pass the *IP address* parameter.
17+
In this document, you will go through the basic steps to use IP Geolocation API PHP SDK.
18+
You need a valid 'IPGeolocation API key' to use this SDK. [Sign up](https://ipgeolocation.io/signup) here and get your free API key if you don't have one.
19+
20+
## System Requirements
21+
Internet connection is required to run this component.
22+
23+
## Basic Usage
24+
Call method **get_location($apikey, $clientIp)** passing *IP address (optional)* and *API key* as parameters and it will return IP Geolocation API response.
25+
Note: If you want IP to geolocation for the machine calling IPGeolocation API, leave out the *IP address* parameter.
726

8-
### Basic Usage
927
```php
1028
<?php
1129
$clientIp = "IP_ADDRESS";
1230
$apikey = "YOUR_API_KEY";
13-
1431
$response = get_location($apikey, $clientIp);
1532
$resArr = array();
1633
$resArr = json_decode($response);
17-
1834
echo "<pre>"; print_r($resArr); echo "</pre>";
35+
1936
function get_location($apiKey, $ip = null) {
2037
$url = "https://api.ipgeolocation.io/ipgeo?apiKey=".$apiKey."&ip=".$ip;
2138
$cURL = curl_init();
39+
2240
curl_setopt($cURL, CURLOPT_URL, $url);
2341
curl_setopt($cURL, CURLOPT_HTTPGET, true);
24-
2542
curl_setopt($cURL, CURLOPT_HTTPHEADER, array(
2643
'Content-Type: application/json',
2744
'Accept: application/json'

0 commit comments

Comments
 (0)