-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
6778 lines (6155 loc) · 269 KB
/
openapi.yaml
File metadata and controls
6778 lines (6155 loc) · 269 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.7
info:
title: 'IPGeolocation.io'
version: "3.0"
description: |
Combined OpenAPI specification for all IPGeolocation.io APIs.
Includes IP Geolocation, IP Security, ASN Lookup, Abuse Contact,
Astronomy, Timezone, and User Agent endpoints.
## API Overview
This collection covers the following API groups:
- **IP Geolocation**: Single and bulk IP/domain geolocation lookups
- **IP Security**: VPN, proxy, Tor, bot, and threat intelligence
- **ASN Lookup**: Autonomous System Number metadata and routing data
- **IP Abuse Contact**: Registry-based abuse contact information
- **Timezone**: Timezone lookup and time conversion
- **User Agent**: Parse browser, device, and OS from User-Agent strings
- **Astronomy**: Sunrise/sunset, moon phase, and astronomical data
All endpoints are available at `https://api.ipgeolocation.io` and require an API key passed as the `apiKey` query parameter.
Full documentation: https://ipgeolocation.io/documentation
servers:
- url: https://api.ipgeolocation.io
description: IPGeolocation.io production server
tags:
- name: IP Geolocation
description: |
IP geolocation API endpoints for looking up geographic location, network routing,
ASN ownership, company attribution, timezone, currency, security threat intelligence,
abuse contact, and User-Agent data. Accepts IPv4 addresses, IPv6 addresses, and
domain names. The single lookup endpoint (`GET /v3/ipgeo`) resolves one IP or domain
per request. The bulk lookup endpoint (`POST /v3/ipgeo-bulk`) accepts up to 50,000
entries per request and requires a paid plan.
- name: IP Security
description: |
IP security intelligence endpoints used to detect VPNs,
proxies, Tor exit nodes, relay networks, bot activity,
spam activity, cloud providers, and other anonymization
technologies associated with IP addresses.
The single lookup endpoint (`GET /v3/security`) analyzes
one IP per request.
The bulk lookup endpoint (`POST /v3/security-bulk`)
accepts up to 50,000 IP addresses per request.
- name: ASN Lookup
description: |
API endpoint for retrieving Autonomous System Number (ASN) information
associated with IPv4 addresses, IPv6 addresses, or specific ASN numbers.
The response includes ASN metadata such as the ASN number, organization
name, country of registration, ASN type, domain, allocation details,
routing statistics, and the Regional Internet Registry (RIR) responsible
for the allocation.
Additional routing intelligence such as peers, upstreams, downstreams,
announced routes, and raw WHOIS registry data can also be retrieved
using the `include` parameter.
This information helps analyze internet routing, identify network
operators, and understand how Autonomous Systems interconnect
across the internet.
- name: IP Abuse Contact
description: |
API endpoint for retrieving abuse contact information associated
with IPv4 and IPv6 addresses. The response contains registry-based
contact details for reporting malicious or abusive network activity
such as spam, phishing, DDoS attacks, or unauthorized access attempts.
- name: Timezone
description: |
API endpoints for retrieving current date, time, and timezone
information for a given input such as an IANA timezone identifier,
geographic coordinates, location address, IPv4 or IPv6 address,
airport codes (IATA or ICAO), or UN/LOCODE.
The API can also convert timestamps between different timezones,
locations, coordinates, airports, or UN/LOCODE identifiers.
Responses include detailed timezone metadata such as UTC offset,
daylight saving time (DST) status, formatted timestamps, and
upcoming DST transition information. Depending on the lookup
method used, the response may also include geolocation data,
airport details, or city information.
- name: User Agent
description: |
API endpoints for parsing user agent strings into browser, device, layout engine,
and operating system details. Supports single lookups via request header, custom
string lookups via JSON body, and bulk parsing of up to 50,000 strings per request.
Also detects bots, crawlers, and malicious or malformed user agent strings.
- name: Astronomy
description: |
API endpoints for retrieving astronomical information for a given
location, including sunrise and sunset times, moonrise and moonset
times, twilight phases, golden hour and blue hour windows, solar noon,
sun and moon position data (altitude, azimuth, distance), and moon
phase.
A time series endpoint is also available to retrieve daily astronomical
data across a date range of up to 90 days.
paths:
/v3/ipgeo:
get:
name: IPGeolocaiton API
operationId: lookupIpGeolocation
security:
- ApiKeyAuth: []
summary: Single IP Geolocation Lookup
description: |
Returns geolocation and enrichment data for a single IPv4 address, IPv6 address,
or domain name. When `ip` is omitted, the API resolves the caller's public IP
automatically, which is useful for client-side lookups.
The base response always includes `location`, `country_metadata`, `currency`,
`asn`, and `time_zone`. Paid plans also get `network` and `company` by default.
Use the `include` parameter to add optional modules such as `security`, `abuse`,
`user_agent`, `geo_accuracy`, `dma_code`, and hostname resolution.
Use `fields` and `excludes` to control exactly which parts of the response you
receive. This reduces payload size and can improve response times.
tags:
- IP Geolocation
parameters:
- name: ip
in: query
required: false
description: |
An IPv4 address, IPv6 address, or domain name to look up. When omitted, the API
resolves the public IP of the requesting client. Empty or whitespace-only values
are treated the same as omission and resolve caller IP. Domain lookups require a
paid plan. Pass `ip` only once. If multiple `ip` query parameters are sent,
values may be merged and treated as invalid input (HTTP 400).
schema:
type: string
example: "ipgeolocation.io"
- name: lang
in: query
required: false
description: |
Language code for translated location names. Defaults to `en`. Non-English
responses require a paid plan. Free plans always receive English regardless
of this parameter. Unsupported `lang` values return HTTP 400. Language code. Supported values: `en`, `de`, `ru`, `ja`, `fr`, `cn`, `es`, `cs`, `it`, `ko`, `fa`, `pt`. Defaults to `en`.
schema:
type: string
default: "en"
- name: include
in: query
required: false
description: |
Comma-separated list of optional data modules to add to the response. These are
not returned by default. Requires a paid plan.
If multiple hostname options are passed in `include`, hostname resolution uses
this precedence order: `liveHostname` first, then `hostname`, then
`hostnameFallbackLive`.
If none is specified, the `hostname` field is not returned.
For `user_agent`, the API parses the `User-Agent` header from the request. For
server-side calls, forward your visitor's User-Agent string in the header so the
parsed result matches the actual visitor.
For additional query parameters (`include`, `fields`, `excludes`, `output`),
unknown values are ignored. The API still returns HTTP 200 and applies only
recognized values.
Free plan behavior for `include=*`: the API returns HTTP 200 and ignores the
include request, returning only base response fields. In contrast, specific
include values such as `include=security` return HTTP 401 on free plans.
schema:
type: string
example: "*"
- name: fields
in: query
required: false
description: |
Comma-separated list of fields or objects to return. Everything else is omitted.
The `ip` field is always returned regardless of this filter.
Supports dot-notation for nested fields: `location.city`, `asn.organization`.
To return an entire object, use the object key: `location`, `security`.
If a field belongs to an optional module (e.g. `security.threat_score`), you
must also pass the corresponding `include` value.
If you omit `include`, the request still succeeds, but fields from optional
modules are not returned.
If the same field or object is specified in both `fields` and `excludes`, the
object is still returned, but it will be empty.
If the same field or object is specified in `include`, `fields`, and `excludes`,
`include` takes priority over both `fields` and `excludes`.
If you list both an object key and one of its nested fields separated by comma
(e.g. `security,security.threat_score`), the full object is returned.
Unknown field paths are ignored. The API still returns HTTP 200.
Available on all plans including Free.
schema:
type: string
example: "location.city,security.threat_score,security.is_vpn"
- name: excludes
in: query
required: false
description: |
Comma-separated list of fields or objects to remove from the response. The `ip`
field cannot be excluded.
Supports dot-notation for nested fields: `location.continent_code`.
To exclude an entire object, use the object key: `currency`, `time_zone`.
If the same field or object is specified in both `fields` and `excludes`, the
object is still returned, but it will be empty.
If the same field or object is specified in `include`, `fields`, and `excludes`,
`include` takes priority over both `fields` and `excludes`.
Unknown fields or object keys in `excludes` are ignored. The API still returns
HTTP 200.
Available on all plans including Free.
schema:
type: string
example: "location.continent_code,currency,company.type"
- name: output
in: query
required: false
description: |
Desired response format. Defaults to `json` if not specified. You can also
control the format using the `Accept` header (`application/json`,
`application/xml`, or `text/xml`). If both are provided, the `output` parameter
takes precedence.
If `output` is unknown or unsupported, it is ignored and the response defaults
to JSON (`application/json`) with HTTP 200. Supported values: `json`, `xml`. Defaults to `json`.
schema:
type: string
default: json
responses:
"200":
description: Geolocation data for the requested IP or domain.
headers:
X-Credits-Charged:
description: Number of API credits consumed by this request.
schema:
type: number
example: 1
content:
application/json:
schema:
$ref: "#/components/schemas/IpGeolocationResponse"
examples:
paidFullResponse:
summary: Paid plan, all modules included
value:
ip: "91.128.103.196"
hostname: "91.128.103.196"
location:
continent_code: "EU"
continent_name: "Europe"
country_code2: "SE"
country_code3: "SWE"
country_name: "Sweden"
country_name_official: "Kingdom of Sweden"
country_capital: "Stockholm"
state_prov: "Stockholms län"
state_code: "SE-AB"
district: "Stockholm"
city: "Stockholm"
locality: "Stockholm"
accuracy_radius: "4.395"
confidence: "high"
dma_code: ""
zipcode: "164 40"
latitude: "59.40510"
longitude: "17.95510"
is_eu: true
country_flag: "https://ipgeolocation.io/static/flags/se_64.png"
geoname_id: "9972319"
country_emoji: "\U0001F1F8\U0001F1EA"
country_metadata:
calling_code: "+46"
tld: ".se"
languages:
- "sv-SE"
- "se"
- "sma"
- "fi-SE"
network:
connection_type: ""
route: "91.128.0.0/14"
is_anycast: false
currency:
code: "SEK"
name: "Swedish Krona"
symbol: "kr"
asn:
as_number: "AS1257"
organization: "Tele2 Sverige AB"
country: "SE"
type: "ISP"
domain: "tele2.com"
date_allocated: "2024-12-13"
rir: "RIPE"
company:
name: "Tele2 Sverige AB"
type: "ISP"
domain: "tele2.com"
security:
threat_score: 0
is_tor: false
is_proxy: false
proxy_provider_names: []
proxy_confidence_score: 0
proxy_last_seen: ""
is_residential_proxy: false
is_vpn: false
vpn_provider_names: []
vpn_confidence_score: 0
vpn_last_seen: ""
is_relay: false
relay_provider_name: ""
is_anonymous: false
is_known_attacker: false
is_bot: false
is_spam: false
is_cloud_provider: false
cloud_provider_name: ""
abuse:
route: "91.128.0.0/14"
country: "SE"
name: "Swipnet Staff"
organization: ""
kind: "group"
address: "Tele2 AB/Swedish IP Network, IP Registry, Torshamnsgatan 17 164 40 Kista SWEDEN"
emails:
- "abuse@tele2.com"
phone_numbers:
- "+46 8 5626 42 10"
time_zone:
name: "Europe/Stockholm"
offset: 1
offset_with_dst: 1
current_time: "2026-02-13 09:19:24.410+0100"
current_time_unix: 1770970764.41
current_tz_abbreviation: "CET"
current_tz_full_name: "Central European Standard Time"
standard_tz_abbreviation: "CET"
standard_tz_full_name: "Central European Standard Time"
is_dst: false
dst_savings: 0
dst_exists: true
dst_tz_abbreviation: "CEST"
dst_tz_full_name: "Central European Summer Time"
dst_start:
utc_time: "2026-03-29 TIME 01:00"
duration: "+1.00H"
gap: true
date_time_after: "2026-03-29 TIME 03:00"
date_time_before: "2026-03-29 TIME 02:00"
overlap: false
dst_end:
utc_time: "2026-10-25 TIME 01:00"
duration: "-1.00H"
gap: false
date_time_after: "2026-10-25 TIME 02:00"
date_time_before: "2026-10-25 TIME 03:00"
overlap: true
user_agent:
user_agent_string: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0"
name: "Edge"
type: "Browser"
version: "143"
version_major: "143"
device:
name: "Linux Desktop"
type: "Desktop"
brand: "Unknown"
cpu: "Intel x86_64"
engine:
name: "Blink"
type: "Browser"
version: "143"
version_major: "143"
operating_system:
name: "Linux"
type: "Desktop"
version: "??"
version_major: "??"
build: "??"
freeMinimalResponse:
summary: Free plan default response
value:
ip: "165.227.0.0"
location:
continent_code: "NA"
continent_name: "North America"
country_code2: "US"
country_code3: "USA"
country_name: "United States"
country_name_official: "United States of America"
country_capital: "Washington, D.C."
state_prov: "California"
state_code: "US-CA"
district: "Santa Clara County"
city: "Santa Clara"
zipcode: "95051"
latitude: "37.35983"
longitude: "-121.98144"
is_eu: false
country_flag: "https://ipgeolocation.io/static/flags/us_64.png"
geoname_id: "5346804"
country_emoji: "\U0001F1FA\U0001F1F8"
country_metadata:
calling_code: "+1"
tld: ".us"
languages:
- "en-US"
- "es-US"
- "haw"
- "fr"
currency:
code: "USD"
name: "US Dollar"
symbol: "$"
asn:
as_number: "AS14061"
organization: "DigitalOcean, LLC"
country: "US"
time_zone:
name: "America/Los_Angeles"
offset: -8
offset_with_dst: -8
current_time: "2026-02-09 09:54:51.206-0800"
current_time_unix: 1770659691.206
current_tz_abbreviation: "PST"
current_tz_full_name: "Pacific Standard Time"
standard_tz_abbreviation: "PST"
standard_tz_full_name: "Pacific Standard Time"
is_dst: false
dst_savings: 0
dst_exists: true
dst_tz_abbreviation: "PDT"
dst_tz_full_name: "Pacific Daylight Time"
dst_start:
utc_time: "2026-03-08 TIME 10:00"
duration: "+1.00H"
gap: true
date_time_after: "2026-03-08 TIME 03:00"
date_time_before: "2026-03-08 TIME 02:00"
overlap: false
dst_end:
utc_time: "2026-11-01 TIME 09:00"
duration: "-1.00H"
gap: false
date_time_after: "2026-11-01 TIME 01:00"
date_time_before: "2026-11-01 TIME 02:00"
overlap: true
"400":
description: |
Bad request. Returned for one of the following reasons:
- The provided IPv4 address, IPv6 address, or domain name is invalid.
- Special characters such as ( ) [ ] { } | ^ ` are present in the API URL,
either in a parameter name or its value (especially in the API key).
- For the `ipgeo-bulk` endpoint:
- The request payload is empty or missing.
- The JSON body is malformed.
- The `ips` field is missing or the `ips` array is empty.
- More than 50,000 IP addresses are provided in the request.
- An invalid or unsupported `lang` parameter is provided.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
invalidIp:
summary: Invalid IPv4/IPv6/domain input
value:
message: "Provided name, service or IP address '999.999.999.999' is not valid."
specialCharacters:
summary: Special characters in API URL or key
value:
message: "Invalid character found in the request target."
malformedJson:
summary: Malformed JSON body for bulk endpoint
value:
message: "Malformed JSON request or invalid field"
missingIps:
summary: Bulk body missing ips field
value:
message: "IP addresses for bulk lookup are missing"
emptyBulkIps:
summary: Bulk ips array is empty
value:
message: "'ips' must not be empty or null"
tooManyBulkEntries:
summary: Bulk body exceeds 50,000 entries
value:
message: "No. of lookup queries cannot be more than 50000"
invalidLang:
summary: Unsupported lang parameter value
value:
message: "This 'zz' lang is not valid. Please use 'en' as the default language"
"401":
description: |
Unauthorized. Returned for one of the following reasons:
- The `apiKey` URL parameter is missing.
- An invalid (random or incorrect) API key is provided.
- The account has been disabled or locked due to abuse or illegal activity.
- The API request is made using an API key for a database subscription.
- The subscription is in a 'paused' state.
- The subscription trial has expired.
- The account’s active-until date has passed and renewal or upgrade is required.
- Any of the following `include` values are used with a Free/Developer plan API key:
`hostname`, `liveHostname`, `hostnameFallbackLive`, `security`,
`abuse`, `geo_accuracy`, `dma_code`, or `user_agent`.
- The bulk IP geolocation endpoint is called using a Free subscription API key.
- The bulk IP geolocation endpoint is called using Request Origin (CORS)
authentication. Bulk requests require an `apiKey` and cannot be authenticated
using Request Origin alone.
- A domain name lookup is performed using a Free subscription API key.
- A language other than English is specified in the `lang` parameter
while using a Free/Developer plan API key.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
missingApiKey:
summary: Missing API key
value:
message: "Please provide an API key (as 'apiKey=YOUR_API_KEY' URL parameter) to use IPGeolocation API. To get your free API Key, sign up at https://app.ipgeolocation.io/login"
invalidApiKey:
summary: Invalid API key
value:
message: "Provided API key is not valid. Contact technical support for assistance at support@ipgeolocation.io"
lockedAccount:
summary: Account locked or disabled
value:
message: "Your account has been locked to use IPGeolocation API. Contact technical support for assistance at support@ipgeolocation.io"
databaseSubscriptionKey:
summary: Database subscription API key used for REST API
value:
message: "You cannot query IPGeolocation API on a database plan subscription. "
pausedSubscription:
summary: Subscription is paused
value:
message: "Your subscription has been paused. Please resume your subscription to use IPGeolocation API."
expiredSubscription:
summary: Subscription expired or trial ended
value:
message: "Your subscription has expired at DATE. Please subscribe to a paid plan to continue using IPGeolocation API without interruption or contact technical support for assistance at support@ipgeolocation.io"
freePlanBulk:
summary: Free plan used for bulk endpoint
value:
message: "Bulk IP to geolocation lookup is not supported on your current subscription. This feature is available to all paid subscriptions only."
requestOriginBulk:
summary: Bulk endpoint called using Request Origin authentication
value:
message: "Bulk queries are not allowed with request origins. Please use some API key to perform bulk queries."
freePlanInclude:
summary: Free plan used with restricted include parameter
value:
message: "This feature is not supported on your subscription. This feature is available on Paid subscriptions only."
freePlanDomain:
summary: Free plan used with domain lookup
value:
message: "IP to geolocation lookup for domain or service name is not supported on your current subscription. This feature is available to all paid subscriptions only."
freePlanLang:
summary: Free plan used with non-English lang value
value:
message: "This 'de' lang is not supported for your current subscription. Please use 'en' as the default language or upgrade your subscription to use this feature."
"404":
description: |
Not found. Returned for one of the following reasons:
- A syntactically valid IPv4 or IPv6 address does not exist in the IPGeolocation database.
- An IPv4 address, IPv6 address, or domain name is passed as a path variable
instead of as a URL query parameter (e.g., using `/v3/ipgeo/8.8.8.8`
instead of `/v3/ipgeo?ip=8.8.8.8`).
- A non-existent or incorrect API endpoint is called.
Invalid or malformed IPv4, IPv6, or domain input returns HTTP 400 instead.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
ipNotInDatabase:
summary: IPv4/IPv6 not found in database
value:
message: "Provided IPv4 or IPv6 address does not exist in our database."
ipAsPathVariable:
summary: IP passed as path variable instead of query parameter
value:
message: "No endpoint GET /v3/ipgeo/8.8.8.8."
wrongEndpoint:
summary: Incorrect or non-existent endpoint
value:
message: "No endpoint GET /v3/security-invalid."
"405":
$ref: "#/components/responses/MethodNotAllowed"
"423":
$ref: "#/components/responses/Locked"
"429":
$ref: "#/components/responses/TooManyRequests"
"499":
$ref: "#/components/responses/ClientClosedRequest"
"500":
$ref: "#/components/responses/InternalServerError"
"502":
$ref: "#/components/responses/BadGateway"
"503":
$ref: "#/components/responses/ServiceUnavailable"
"504":
$ref: "#/components/responses/GatewayTimeout"
"505":
$ref: "#/components/responses/HttpVersionNotSupported"
/v3/ipgeo-bulk:
post:
operationId: bulkLookupIpGeolocation
security:
- ApiKeyAuth: []
summary: Bulk IP Geolocation Lookup
description: |
Returns geolocation and enrichment data for up to 50,000 IPv4 addresses, IPv6
addresses, or domain names in a single request. The request body must be a JSON
object with an `ips` array.
This endpoint requires a paid plan. Calling it with a free
plan API key returns HTTP 401.
The response is a JSON array with one element per IP in the request. Each element
is either a full geolocation response object or an error object with only a
`message` field. Invalid, bogon, and unresolvable entries appear as error
objects. Invalid, private, and bogon IPs are not billed.
This endpoint supports the same query parameters as the single lookup endpoint,
including `lang`, `include`, `fields`, `excludes`, and `output`.
Credits are calculated as: credits per lookup multiplied by the number of valid
IPs in the request. The total is returned in the `X-Credits-Charged` response
header. When at least one submitted ip is invalid, the `X-Successful-Record`
response header indicates how many entries were successfully resolved.
Only the `POST` method is accepted. Sending a `GET` request returns HTTP 405.
tags:
- IP Geolocation
parameters:
- name: lang
in: query
required: false
description: |
Language code for translated location names. Defaults to `en`. Non-English
responses require a paid plan. Free plans always receive English regardless
of this parameter. Unsupported `lang` values return HTTP 400. Language code. Supported values: `en`, `de`, `ru`, `ja`, `fr`, `cn`, `es`, `cs`, `it`, `ko`, `fa`, `pt`. Defaults to `en`.
schema:
type: string
default: "en"
- name: include
in: query
required: false
description: |
Comma-separated list of optional data modules to add to the response. These are
not returned by default. Requires a paid plan.
If multiple hostname options are passed in `include`, hostname resolution uses
this precedence order: `liveHostname` first, then `hostname`, then
`hostnameFallbackLive`.
If none is specified, the `hostname` field is not returned.
For `user_agent`, the API parses the `User-Agent` header from the request. For
server-side calls, forward your visitor's User-Agent string in the header so the
parsed result matches the actual visitor.
For additional query parameters (`include`, `fields`, `excludes`, `output`),
unknown values are ignored. The API still returns HTTP 200 and applies only
recognized values.
Free plan behavior for `include=*`: the API returns HTTP 200 and ignores the
include request, returning only base response fields. In contrast, specific
include values such as `include=security` return HTTP 401 on free plans.
schema:
type: string
example: "*"
- name: fields
in: query
required: false
description: |
Comma-separated list of fields or objects to return. Everything else is omitted.
The `ip` field is always returned regardless of this filter.
Supports dot-notation for nested fields: `location.city`, `asn.organization`.
To return an entire object, use the object key: `location`, `security`.
If a field belongs to an optional module (e.g. `security.threat_score`), you
must also pass the corresponding `include` value.
If you omit `include`, the request still succeeds, but fields from optional
modules are not returned.
If the same field or object is specified in both `fields` and `excludes`, the
object is still returned, but it will be empty.
If the same field or object is specified in `include`, `fields`, and `excludes`,
`include` takes priority over both `fields` and `excludes`.
If you list both an object key and one of its nested fields separated by comma
(e.g. `security,security.threat_score`), the full object is returned.
Unknown field paths are ignored. The API still returns HTTP 200.
Available on all plans including Free.
schema:
type: string
example: "location.city,security.threat_score,security.is_vpn"
- name: excludes
in: query
required: false
description: |
Comma-separated list of fields or objects to remove from the response. The `ip`
field cannot be excluded.
Supports dot-notation for nested fields: `location.continent_code`.
To exclude an entire object, use the object key: `currency`, `time_zone`.
If the same field or object is specified in both `fields` and `excludes`, the
object is still returned, but it will be empty.
If the same field or object is specified in `include`, `fields`, and `excludes`,
`include` takes priority over both `fields` and `excludes`.
Unknown fields or object keys in `excludes` are ignored. The API still returns
HTTP 200.
Available on all plans including Free.
schema:
type: string
example: "location.continent_code,currency,company.type"
- name: output
in: query
required: false
description: |
Desired response format. Defaults to `json` if not specified. You can also
control the format using the `Accept` header (`application/json`,
`application/xml`, or `text/xml`). If both are provided, the `output` parameter
takes precedence.
If `output` is unknown or unsupported, it is ignored and the response defaults
to JSON (`application/json`) with HTTP 200. Supported values: `json`, `xml`. Defaults to `json`.
schema:
type: string
default: json
requestBody:
required: true
description: |
A JSON object containing an `ips` array. Each element is a string representing
an IPv4 address, IPv6 address, or domain name. The array must not be empty and
must not contain more than 50,000 entries.
content:
application/json:
schema:
$ref: "#/components/schemas/BulkGeolocationRequest"
examples:
mixedIps:
summary: Mixed IPv4, IPv6, and domain
value:
ips:
- "8.8.8.8"
- "91.128.103.196"
- "2607:fb91:16c6:8860:e531:2d1d:4944:6c7c"
- "ipgeolocation.io"
ipv4Only:
summary: Multiple IPv4 addresses
value:
ips:
- "1.1.1.1"
- "8.8.4.4"
- "165.227.0.0"
responses:
"200":
description: |
An array of results, one per input entry. Valid entries return full
geolocation objects. Invalid, bogon, and unresolvable entries return
objects with only a `message` field.
`X-Successful-Record` is returned only when at least one submitted entry
fails and the number of successful lookups is lower than the number of
submitted entries.
headers:
X-Credits-Charged:
description: |
Total number of API credits consumed. Equals credits per lookup
multiplied by the count of valid IPs.
schema:
type: number
example: 3
X-Successful-Record:
description: |
Number of valid IP addresses or domains that were successfully resolved in
this bulk request. Invalid, bogon, and private IPs are not counted.
This header is included only when at least one bulk entry returns an
error message and total successful lookups are fewer than submitted
entries.
schema:
type: number
example: 4
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/BulkGeolocationResponseItem"
examples:
bulkResponse:
summary: Bulk response with one valid and one error entry
value:
- ip: "8.8.8.8"
location:
continent_code: "NA"
continent_name: "North America"
country_code2: "US"
country_code3: "USA"
country_name: "United States"
country_name_official: "United States of America"
country_capital: "Washington, D.C."
state_prov: "California"
state_code: "US-CA"
district: "Santa Clara County"
city: "Mountain View"
zipcode: "94043"
latitude: "37.42240"
longitude: "-122.08421"
is_eu: false
country_flag: "https://ipgeolocation.io/static/flags/us_64.png"
geoname_id: "5375480"
country_emoji: "\U0001F1FA\U0001F1F8"
country_metadata:
calling_code: "+1"
tld: ".us"
languages:
- "en-US"
- "es-US"
- "haw"
- "fr"
network:
connection_type: ""
route: "8.8.8.0/24"
is_anycast: true
currency:
code: "USD"
name: "US Dollar"
symbol: "$"
asn:
as_number: "AS15169"
organization: "Google LLC"
country: "US"
type: "BUSINESS"
domain: "google.com"
date_allocated: "2000-03-30"
rir: "ARIN"
company:
name: "Google LLC"
type: "HOSTING"
domain: "google.com"
time_zone:
name: "America/Los_Angeles"
offset: -8
offset_with_dst: -8
current_time: "2026-02-09 09:54:51.206-0800"
current_time_unix: 1770659691.206
current_tz_abbreviation: "PST"
current_tz_full_name: "Pacific Standard Time"
standard_tz_abbreviation: "PST"
standard_tz_full_name: "Pacific Standard Time"
is_dst: false
dst_savings: 0
dst_exists: true
dst_tz_abbreviation: "PDT"
dst_tz_full_name: "Pacific Daylight Time"
dst_start:
utc_time: "2026-03-08 TIME 10:00"
duration: "+1.00H"
gap: true
date_time_after: "2026-03-08 TIME 03:00"
date_time_before: "2026-03-08 TIME 02:00"
overlap: false
dst_end:
utc_time: "2026-11-01 TIME 09:00"
duration: "-1.00H"
gap: false
date_time_after: "2026-11-01 TIME 01:00"
date_time_before: "2026-11-01 TIME 02:00"
overlap: true
- message: "'10.0.0.1' is a bogon IP address."
"400":
description: |
Bad request. Returned for one of the following reasons:
- The provided IPv4 address, IPv6 address, or domain name is invalid.
- Special characters such as ( ) [ ] { } | ^ ` are present in the API URL,
either in a parameter name or its value (especially in the API key).
- For the `ipgeo-bulk` endpoint:
- The request payload is empty or missing.
- The JSON body is malformed.
- The `ips` field is missing or the `ips` array is empty.
- More than 50,000 IP addresses are provided in the request.
- An invalid or unsupported `lang` parameter is provided.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
invalidIp:
summary: Invalid IPv4/IPv6/domain input
value:
message: "Provided name, service or IP address '999.999.999.999' is not valid."
specialCharacters:
summary: Special characters in API URL or key
value:
message: "Invalid character found in the request target."
malformedJson:
summary: Malformed JSON body for bulk endpoint
value:
message: "Malformed JSON request or invalid field"
missingIps:
summary: Bulk body missing ips field
value:
message: "IP addresses for bulk lookup are missing"
emptyBulkIps:
summary: Bulk ips array is empty
value:
message: "'ips' must not be empty or null"
tooManyBulkEntries:
summary: Bulk body exceeds 50,000 entries
value:
message: "No. of lookup queries cannot be more than 50000"
invalidLang:
summary: Unsupported lang parameter value
value:
message: "This 'zz' lang is not valid. Please use 'en' as the default language"
"401":
description: |
Unauthorized. Returned for one of the following reasons:
- The `apiKey` URL parameter is missing.
- An invalid (random or incorrect) API key is provided.
- The account has been disabled or locked due to abuse or illegal activity.
- The API request is made using an API key for a database subscription.
- The subscription is in a 'paused' state.
- The subscription trial has expired.
- The account’s active-until date has passed and renewal or upgrade is required.
- Any of the following `include` values are used with a Free/Developer plan API key:
`hostname`, `liveHostname`, `hostnameFallbackLive`, `security`,
`abuse`, `geo_accuracy`, `dma_code`, or `user_agent`.
- The bulk IP geolocation endpoint is called using a Free subscription API key.
- The bulk IP geolocation endpoint is called using Request Origin (CORS)
authentication. Bulk requests require an `apiKey` and cannot be authenticated
using Request Origin alone.
- A domain name lookup is performed using a Free subscription API key.
- A language other than English is specified in the `lang` parameter
while using a Free/Developer plan API key.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
missingApiKey:
summary: Missing API key
value:
message: "Please provide an API key (as 'apiKey=YOUR_API_KEY' URL parameter) to use IPGeolocation API. To get your free API Key, sign up at https://app.ipgeolocation.io/login"
invalidApiKey:
summary: Invalid API key
value:
message: "Provided API key is not valid. Contact technical support for assistance at support@ipgeolocation.io"
lockedAccount:
summary: Account locked or disabled
value:
message: "Your account has been locked to use IPGeolocation API. Contact technical support for assistance at support@ipgeolocation.io"
databaseSubscriptionKey:
summary: Database subscription API key used for REST API
value:
message: "You cannot query IPGeolocation API on a database plan subscription. "
pausedSubscription: