Bulk Lookups (Recommended)
You need a paid account with sufficient quota to use this functionality.

Batch lookup

Perhaps the most useful command provided by the CLI is the ability to process a csv file with a list of IP addresses and write the results to file as either CSV or JSON! It could be a list of tens of thousands to millions of IP addresses and it will all be processed and the results filtered to your liking!
When you use the JSON output format, the results are written to the output file you provide with one result per line. Each line being a valid and full JSON response object.
If you only need a few fields eg. only the country name you can specify a field argument with the names of the fields you want, if you combine this with the CSV output format you will get very clean results with only the data you need!

To get full JSON responses for further processing

1
ipdata batch my_ip_backlog.csv --output geolocation_results.json
Copied!
Batch lookup with output to CSV file
1
ipdata batch my_ip_backlog.csv --output results.csv --output-format CSV --fields ip,country_code
Copied!
The --fields option is required for CSV output.

Example Results

1
# ip,country_code
2
107.175.75.83,US
3
35.155.95.229,US
4
13.0.0.164,US
5
209.248.120.14,US
6
142.0.202.238,US
7
...
Copied!
Last modified 11mo ago