Get the geolocation data of all the IP addresses uploaded.
POST {{baseUrl}}/v1/geo/csv?strict_parse=false
What
Get the geo location data of all the IP addresses uploaded in a text file. This information includes: - Latitude and longitude - Time zone - Accuracy radius - Postal code - City name - Region - Country - Country of the service provider - Continent - Reverse PTR hostnames
Parameters
- A text file with a list of public IPv4 or IPv6 addresses.
- A header
Content-Type: multipart/form-data
is required. - (optional) in the query string the parameeter
strict_parse
: If set totrue
, no malformed IP addresses allowed, returning an error. If set tofalse
, malformed IP addresses will be ignored.
Example:
curl -X 'POST' \
'https://dublin.api.threatjammer.com/v1/geo/csv[?strict_parse=true|false]' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: multipart/form-data' \
-F 'csv_file=@YOUR_TEXT_FILE;type=text/csv'
Result
The result contains a list of the result for each IP address, with the following data set:
The result is a JSON object with the following structure:
- self
: the URI of the API call
- accuracy_radius
: The radius in kilometers around the specified location where the IP address is likely to be.
- asn_country_iso_code
: The ISO code of the country of the Autonomous System (AS) owner of the IP address.
- city_geoname_code
:: City geoname code. The geoname code by [GeoNames](https://en.wikipedia.org/wiki/GeoNames) is a unique identifier assigned to each geographical point on the globe.
-
cityname:
: City name, in english. The developer can use the geoname code to localize the name of the city.
- ``continentcode: The continent code. It can be any of the following: AF, AN, AS, EU, NA, OC, SA.
-
countryisocode: The country ISO 3166-1 alpha-2 code.
-
hostnames: The list of hostnames associated with the IP address obtained from the reverse DNS lookup.
-
latitude: The latitude of the geolocation.
-
longitude: The longitude of the geolocation.
-
postalcode:
: The postal code of the city.
- ``regiongeonamecode:
: The geoname code of the region.
- ``regionname:
: The region name, in english. The developer can use the geoname code to localize the name of the region.
- time_zone
: The name of the time zone.
Errors
The endpoint will return the following errors:
- a 422 Unprocessable Entity
error if the IP address is malformed.
The private IP addresses will be ignored, if any.
When the strict_parse
parameter is set to true
, the endpoint will return the following errors:
- a 400 Bad Request
.
It will also return the API Global errors described in the API description.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
strict_parse | boolean | When true , if any IP address entry in the file is malformed, the assessment is canceled. If false , the malformed IP addresses are ignored. Default is false . |
Request Body
[{"name"=>"csv_file", "value"=>"aliquip in", "datatype"=>"string"}]
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
Accept | string |
RESPONSES
status: OK
{"self":"ad ani","results":[{"hostnames":["labore nisi et ipsum commodo","voluptate incididunt in"],"latitude":-56610358.97459157,"longitude":-95198340.64794321,"time_zone":"Ut labore sed sint","accuracy_radius":-74444555.22576886,"postal_code":"ut cillum amet incididunt esse","city_name":"in ut","city_geoname_code":37360575,"region_name":"consectetur enim do cillum","region_geoname_code":-72360207,"country_iso_code":"dolore Ut sunt commodo","asn_country_iso_code":"adipisicing veniam","continent_code":"aute","self":"nostrud ut"},{"hostnames":["adipisicing","exercitation est ullamco fugiat"],"latitude":-6443127.121517062,"longitude":8539841.469378471,"time_zone":"est in ea","accuracy_radius":64380635.643957525,"postal_code":"id adipisicing Excepteur","city_name":"ut commodo cupidatat","city_geoname_code":30113508,"region_name":"aliquip veniam","region_geoname_code":-83795369,"country_iso_code":"dolor nisi esse","asn_country_iso_code":"incididunt","continent_code":"do dolore eiusmod","self":"elit irure dolore sint"}]}