Skip to content

Commit d03e4ee

Browse files
Version 1.0.0 IPGeo API
Updated Readme and Example Request file.
1 parent 89bca7d commit d03e4ee

2 files changed

Lines changed: 10 additions & 21 deletions

File tree

README.md

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@
22

33
## About IPGeo
44

5-
The IPGeo repository on GitHub is a free version of the IP geolocation Module found on [Our Webpage](http://ipgeo.azurewebsites.net/).
5+
The IPGeo repository on GitHub is an pre-coded example of the usage of our [IPGeoSearch](https://github.com/MatthiasRathbun/IPGeo-Search) library based on the IP geolocation API found on [Our Webpage](http://ipgeo.azurewebsites.net/).
66

7-
Paid versions are described more in detail on [Our Webpage](http://ipgeo.azurewebsites.net/).
8-
9-
Our Free Version Includes 10 searches a month. Exceeding the 10 Searches a month will lead to an error as the server will not send back the IP Search Data.
10-
11-
Feel Free to check out the [IPGeoSearch](https://github.com/MatthiasRathbun/IPGeo-Search) library on GitHub for more ways to use our API!
7+
Feel Free to check out the [IPGeoSearch](https://github.com/MatthiasRathbun/IPGeo-Search) library on GitHub for more information and ways to use our API!
128

139
## Requirements
1410

15-
Before running on your local computer, make sure you have `python 3.6+` with the latest version of `pandas` and `IPGeoSearch` installed and `ipList.txt` in the same folder as the python file.
11+
Before running on your local computer, make sure you have `python 3.6+` with the latest version of `pandas` and `IPGeoSearch` installed, your API Key, and `ipList.txt` in the same folder as the python file.
1612

1713
To Install Pandas, run
1814

@@ -51,15 +47,3 @@ python request.py
5147
in your command prompt environment with the pandas installed.
5248

5349
Files named `x.x.x.x.csv` and `x.x.x.x.json` are saved which have the relevant information regarding your IP Search. Files are named with the IP in the file Name. An example csv for a search of Google's IP `8.8.8.8` would be named `8.8.8.8.csv`.
54-
55-
Errors are more than likely caused by a non existent IP in the data base.
56-
57-
### Curl
58-
59-
You can also use `curl` to send requests on the command line as such:
60-
61-
```curl
62-
curl https://ipgeo.azurewebsites.net/try -H "Content-type:application/json" -X POST -d '{"ip":"8.8.8.8"}' -o result.json
63-
```
64-
65-
Using Curl is not recommended as it will not automatically parse the json into a csv and will not automate requests.

request.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
from IPGeoSearch import search
22

33
with open('ipList.txt', 'r') as f:
4-
ips = [line.strip() for line in f]
4+
ip = [line.strip() for line in f]
55
f.close()
66

7-
search.search(ipList=ips,path='results/')
7+
with open('yourkey.key', 'r') as hashkey:
8+
key=hashkey.read().replace('\n', '')
9+
hashkey.close()
10+
11+
search.search(ipList=ip,path='',key=key)
12+

0 commit comments

Comments
 (0)