-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.py
More file actions
1265 lines (1048 loc) · 40.1 KB
/
client.py
File metadata and controls
1265 lines (1048 loc) · 40.1 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
# This file was auto-generated by Fern from our API Definition.
import typing
import httpx
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from .core.request_options import RequestOptions
from .environment import WhoisfreaksApiEnvironment
from .raw_client import AsyncRawWhoisfreaksApi, RawWhoisfreaksApi
from .types.get_v_10_asn_whois_response import GetV10AsnWhoisResponse
from .types.get_v_10_domain_availability_response import GetV10DomainAvailabilityResponse
from .types.get_v_10_ip_whois_response import GetV10IpWhoisResponse
from .types.get_v_10_ssl_live_response import GetV10SslLiveResponse
from .types.get_v_10_whois_response import GetV10WhoisResponse
from .types.get_v_20_dns_historical_response import GetV20DnsHistoricalResponse
from .types.get_v_20_dns_live_response import GetV20DnsLiveResponse
from .types.get_v_21_dns_reverse_response import GetV21DnsReverseResponse
from .types.post_v_10_bulkwhois_response import PostV10BulkwhoisResponse
from .types.post_v_20_dns_bulk_live_response import PostV20DnsBulkLiveResponse
# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)
class WhoisfreaksApi:
"""
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
Parameters
----------
base_url : typing.Optional[str]
The base url to use for requests from the client.
environment : WhoisfreaksApiEnvironment
The environment to use for requests from the client. from .environment import WhoisfreaksApiEnvironment
Defaults to WhoisfreaksApiEnvironment.DEFAULT
timeout : typing.Optional[float]
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
follow_redirects : typing.Optional[bool]
Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
httpx_client : typing.Optional[httpx.Client]
The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
Examples
--------
from whoisfreaks import WhoisfreaksApi
client = WhoisfreaksApi()
"""
def __init__(
self,
*,
base_url: typing.Optional[str] = None,
environment: WhoisfreaksApiEnvironment = WhoisfreaksApiEnvironment.DEFAULT,
timeout: typing.Optional[float] = None,
follow_redirects: typing.Optional[bool] = True,
httpx_client: typing.Optional[httpx.Client] = None,
):
_defaulted_timeout = (
timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
)
self._client_wrapper = SyncClientWrapper(
base_url=_get_base_url(base_url=base_url, environment=environment),
httpx_client=httpx_client
if httpx_client is not None
else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
if follow_redirects is not None
else httpx.Client(timeout=_defaulted_timeout),
timeout=_defaulted_timeout,
)
self._raw_client = RawWhoisfreaksApi(client_wrapper=self._client_wrapper)
@property
def with_raw_response(self) -> RawWhoisfreaksApi:
"""
Retrieves a raw implementation of this client that returns raw responses.
Returns
-------
RawWhoisfreaksApi
"""
return self._raw_client
def whois_lookup(
self,
*,
whois: str,
api_key: str,
domain_name: typing.Optional[str] = None,
keyword: typing.Optional[str] = None,
email: typing.Optional[str] = None,
owner: typing.Optional[str] = None,
company: typing.Optional[str] = None,
mode: typing.Optional[str] = None,
exact: typing.Optional[str] = None,
includes: typing.Optional[str] = None,
page: typing.Optional[str] = None,
format: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> GetV10WhoisResponse:
"""
Fetch live and historical WHOIS data for any domain, and perform reverse lookups to find domains associated with a specific registrant, company, email, or keyword. Instantly retrieve current registration details, explore past WHOIS records, or discover all domains linked to a specific registrant, company, email, or keyword.
Parameters
----------
whois : str
The type of WHOIS lookup (live, historical, reverse)
api_key : str
Your API key
domain_name : typing.Optional[str]
The domain name for Live and Historical WHOIS lookup
keyword : typing.Optional[str]
Keyword to search for in registrant information (optional)
email : typing.Optional[str]
Email to search for (optional)
owner : typing.Optional[str]
Owner to search for (optional)
company : typing.Optional[str]
Company to search for (optional)
mode : typing.Optional[str]
Mode of search (optional)
exact : typing.Optional[str]
Exact match flag (optional)
includes : typing.Optional[str]
Include specific details (optional)
page : typing.Optional[str]
The page number of the reverse records (optional)
format : typing.Optional[str]
Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
GetV10WhoisResponse
Successful lookup
Examples
--------
from whoisfreaks import WhoisfreaksApi
client = WhoisfreaksApi()
client.whois_lookup(whois='whois', api_key='apiKey', )
"""
_response = self._raw_client.whois_lookup(
whois=whois,
api_key=api_key,
domain_name=domain_name,
keyword=keyword,
email=email,
owner=owner,
company=company,
mode=mode,
exact=exact,
includes=includes,
page=page,
format=format,
request_options=request_options,
)
return _response.data
def bulk_domain_lookup(
self,
*,
api_key: str,
format: typing.Optional[str] = None,
domain_names: typing.Optional[typing.Sequence[str]] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> PostV10BulkwhoisResponse:
"""
Fetch Live WHOIS information for a list of domains in bulk
Parameters
----------
api_key : str
Your API key
format : typing.Optional[str]
Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.
domain_names : typing.Optional[typing.Sequence[str]]
List of domain names to lookup
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
PostV10BulkwhoisResponse
Successful bulk WHOIS lookup
Examples
--------
from whoisfreaks import WhoisfreaksApi
client = WhoisfreaksApi()
client.bulk_domain_lookup(api_key='apiKey', )
"""
_response = self._raw_client.bulk_domain_lookup(
api_key=api_key, format=format, domain_names=domain_names, request_options=request_options
)
return _response.data
def ip_whois_lookup(
self,
*,
api_key: str,
ip: str,
format: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> GetV10IpWhoisResponse:
"""
Retrieve real-time information for an IPv4 or IPv6 address
Parameters
----------
api_key : str
Your API key
ip : str
The IPv4 or IPv6 for lookup
format : typing.Optional[str]
Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
GetV10IpWhoisResponse
Successful lookup
Examples
--------
from whoisfreaks import WhoisfreaksApi
client = WhoisfreaksApi()
client.ip_whois_lookup(api_key='apiKey', ip='ip', )
"""
_response = self._raw_client.ip_whois_lookup(
api_key=api_key, ip=ip, format=format, request_options=request_options
)
return _response.data
def asn_lookup(
self,
*,
api_key: str,
asn: str,
format: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> GetV10AsnWhoisResponse:
"""
Retrieve real-time information for an Autonomous System Number
Parameters
----------
api_key : str
Your API key
asn : str
The ASN number for which information is being requested (e.g., "1" or "AS1").
format : typing.Optional[str]
Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
GetV10AsnWhoisResponse
Successful lookup
Examples
--------
from whoisfreaks import WhoisfreaksApi
client = WhoisfreaksApi()
client.asn_lookup(api_key='apiKey', asn='asn', )
"""
_response = self._raw_client.asn_lookup(
api_key=api_key, asn=asn, format=format, request_options=request_options
)
return _response.data
def ssl_live_lookup(
self,
*,
api_key: str,
domain_name: str,
chain: typing.Optional[bool] = None,
ssl_raw: typing.Optional[bool] = None,
format: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> GetV10SslLiveResponse:
"""
Retrieve live SSL information for a specific domain.
Parameters
----------
api_key : str
Your API key
domain_name : str
The domain name for which live SSL information is requested (e.g., "example.com").
chain : typing.Optional[bool]
A boolean flag indicating whether to include SSL certificate chain information.
ssl_raw : typing.Optional[bool]
A boolean flag indicating whether to include raw SSL certificate information.
format : typing.Optional[str]
Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
GetV10SslLiveResponse
Successful lookup
Examples
--------
from whoisfreaks import WhoisfreaksApi
client = WhoisfreaksApi()
client.ssl_live_lookup(api_key='apiKey', domain_name='domainName', )
"""
_response = self._raw_client.ssl_live_lookup(
api_key=api_key,
domain_name=domain_name,
chain=chain,
ssl_raw=ssl_raw,
format=format,
request_options=request_options,
)
return _response.data
def domain_availability_lookup(
self,
*,
api_key: str,
domain: str,
sug: typing.Optional[bool] = None,
count: typing.Optional[int] = None,
format: typing.Optional[str] = None,
source: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> GetV10DomainAvailabilityResponse:
"""
Check availability of a Domain Name.
Parameters
----------
api_key : str
Your API key
domain : str
The domain name for which availability is being checked.
sug : typing.Optional[bool]
A boolean flag indicating whether suggested domains are included.
count : typing.Optional[int]
The number of suggested domains to return.
format : typing.Optional[str]
Format of the response (optional). Default is JSON.
source : typing.Optional[str]
Source information for the domain availability check (optional).
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
GetV10DomainAvailabilityResponse
Successful domain availability lookup
Examples
--------
from whoisfreaks import WhoisfreaksApi
client = WhoisfreaksApi()
client.domain_availability_lookup(api_key='apiKey', domain='whoisfreaks.com', )
"""
_response = self._raw_client.domain_availability_lookup(
api_key=api_key,
domain=domain,
sug=sug,
count=count,
format=format,
source=source,
request_options=request_options,
)
return _response.data
def live_dns_lookup(
self,
*,
api_key: str,
type: str,
domain_name: typing.Optional[str] = None,
ip_address: typing.Optional[str] = None,
format: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> GetV20DnsLiveResponse:
"""
Retrieve live DNS information for a specific domain or IP address.
Parameters
----------
api_key : str
Your API key
type : str
The DNS record type (e.g., A, MX, NS).
domain_name : typing.Optional[str]
The domain name for which live DNS information is requested (e.g., "example.com").
ip_address : typing.Optional[str]
The IP address for which live DNS information is requested (e.g., "8.8.8.8").
format : typing.Optional[str]
The output format (JSON or XML).
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
GetV20DnsLiveResponse
Successful live DNS lookup
Examples
--------
from whoisfreaks import WhoisfreaksApi
client = WhoisfreaksApi()
client.live_dns_lookup(api_key='apiKey', type='type', )
"""
_response = self._raw_client.live_dns_lookup(
api_key=api_key,
type=type,
domain_name=domain_name,
ip_address=ip_address,
format=format,
request_options=request_options,
)
return _response.data
def historical_dns_lookup(
self,
*,
api_key: str,
domain_name: str,
type: str,
page: typing.Optional[int] = None,
format: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> GetV20DnsHistoricalResponse:
"""
Retrieve historical DNS information for a specific domain.
Parameters
----------
api_key : str
Your API key
domain_name : str
The domain name for which historical DNS information is requested (e.g., "example.com").
type : str
The DNS record type (e.g., A, MX, NS).
page : typing.Optional[int]
The page number for paginated results.
format : typing.Optional[str]
The output format (JSON or XML).
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
GetV20DnsHistoricalResponse
Successful historical DNS lookup
Examples
--------
from whoisfreaks import WhoisfreaksApi
client = WhoisfreaksApi()
client.historical_dns_lookup(api_key='apiKey', domain_name='domainName', type='type', )
"""
_response = self._raw_client.historical_dns_lookup(
api_key=api_key,
domain_name=domain_name,
type=type,
page=page,
format=format,
request_options=request_options,
)
return _response.data
def reverse_dns_lookup(
self,
*,
api_key: str,
value: str,
type: str,
page: typing.Optional[int] = None,
format: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> GetV21DnsReverseResponse:
"""
Retrieve reverse DNS information for a given DNS record.
Parameters
----------
api_key : str
Your API key
value : str
The IP address for which reverse DNS information is requested (e.g., "8.8.8.8").
type : str
The type of DNS record to search for (e.g., "A", "MX").
page : typing.Optional[int]
Page number for pagination (optional).
format : typing.Optional[str]
The output format (JSON or XML).
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
GetV21DnsReverseResponse
Successful reverse DNS lookup
Examples
--------
from whoisfreaks import WhoisfreaksApi
client = WhoisfreaksApi()
client.reverse_dns_lookup(api_key='apiKey', value='value', type='type', )
"""
_response = self._raw_client.reverse_dns_lookup(
api_key=api_key, value=value, type=type, page=page, format=format, request_options=request_options
)
return _response.data
def bulk_dns_lookup(
self,
*,
api_key: str,
type: str,
format: typing.Optional[str] = None,
domain_names: typing.Optional[typing.Sequence[str]] = OMIT,
ip_addresses: typing.Optional[typing.Sequence[str]] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> PostV20DnsBulkLiveResponse:
"""
Retrieve DNS information for multiple domains or IP addresses in bulk.
Parameters
----------
api_key : str
Your API key
type : str
The DNS record type to filter by (e.g., "A", "MX", "all").
format : typing.Optional[str]
The output format (JSON or XML).
domain_names : typing.Optional[typing.Sequence[str]]
List of domain names for which DNS information is requested.
ip_addresses : typing.Optional[typing.Sequence[str]]
List of IP addresses for which reverse DNS information is requested.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
PostV20DnsBulkLiveResponse
Successful bulk DNS lookup
Examples
--------
from whoisfreaks import WhoisfreaksApi
client = WhoisfreaksApi()
client.bulk_dns_lookup(api_key='apiKey', type='type', )
"""
_response = self._raw_client.bulk_dns_lookup(
api_key=api_key,
type=type,
format=format,
domain_names=domain_names,
ip_addresses=ip_addresses,
request_options=request_options,
)
return _response.data
class AsyncWhoisfreaksApi:
"""
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
Parameters
----------
base_url : typing.Optional[str]
The base url to use for requests from the client.
environment : WhoisfreaksApiEnvironment
The environment to use for requests from the client. from .environment import WhoisfreaksApiEnvironment
Defaults to WhoisfreaksApiEnvironment.DEFAULT
timeout : typing.Optional[float]
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
follow_redirects : typing.Optional[bool]
Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
httpx_client : typing.Optional[httpx.AsyncClient]
The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
Examples
--------
from whoisfreaks import AsyncWhoisfreaksApi
client = AsyncWhoisfreaksApi()
"""
def __init__(
self,
*,
base_url: typing.Optional[str] = None,
environment: WhoisfreaksApiEnvironment = WhoisfreaksApiEnvironment.DEFAULT,
timeout: typing.Optional[float] = None,
follow_redirects: typing.Optional[bool] = True,
httpx_client: typing.Optional[httpx.AsyncClient] = None,
):
_defaulted_timeout = (
timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
)
self._client_wrapper = AsyncClientWrapper(
base_url=_get_base_url(base_url=base_url, environment=environment),
httpx_client=httpx_client
if httpx_client is not None
else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
if follow_redirects is not None
else httpx.AsyncClient(timeout=_defaulted_timeout),
timeout=_defaulted_timeout,
)
self._raw_client = AsyncRawWhoisfreaksApi(client_wrapper=self._client_wrapper)
@property
def with_raw_response(self) -> AsyncRawWhoisfreaksApi:
"""
Retrieves a raw implementation of this client that returns raw responses.
Returns
-------
AsyncRawWhoisfreaksApi
"""
return self._raw_client
async def whois_lookup(
self,
*,
whois: str,
api_key: str,
domain_name: typing.Optional[str] = None,
keyword: typing.Optional[str] = None,
email: typing.Optional[str] = None,
owner: typing.Optional[str] = None,
company: typing.Optional[str] = None,
mode: typing.Optional[str] = None,
exact: typing.Optional[str] = None,
includes: typing.Optional[str] = None,
page: typing.Optional[str] = None,
format: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> GetV10WhoisResponse:
"""
Fetch live and historical WHOIS data for any domain, and perform reverse lookups to find domains associated with a specific registrant, company, email, or keyword. Instantly retrieve current registration details, explore past WHOIS records, or discover all domains linked to a specific registrant, company, email, or keyword.
Parameters
----------
whois : str
The type of WHOIS lookup (live, historical, reverse)
api_key : str
Your API key
domain_name : typing.Optional[str]
The domain name for Live and Historical WHOIS lookup
keyword : typing.Optional[str]
Keyword to search for in registrant information (optional)
email : typing.Optional[str]
Email to search for (optional)
owner : typing.Optional[str]
Owner to search for (optional)
company : typing.Optional[str]
Company to search for (optional)
mode : typing.Optional[str]
Mode of search (optional)
exact : typing.Optional[str]
Exact match flag (optional)
includes : typing.Optional[str]
Include specific details (optional)
page : typing.Optional[str]
The page number of the reverse records (optional)
format : typing.Optional[str]
Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
GetV10WhoisResponse
Successful lookup
Examples
--------
from whoisfreaks import AsyncWhoisfreaksApi
import asyncio
client = AsyncWhoisfreaksApi()
async def main() -> None:
await client.whois_lookup(whois='whois', api_key='apiKey', )
asyncio.run(main())
"""
_response = await self._raw_client.whois_lookup(
whois=whois,
api_key=api_key,
domain_name=domain_name,
keyword=keyword,
email=email,
owner=owner,
company=company,
mode=mode,
exact=exact,
includes=includes,
page=page,
format=format,
request_options=request_options,
)
return _response.data
async def bulk_domain_lookup(
self,
*,
api_key: str,
format: typing.Optional[str] = None,
domain_names: typing.Optional[typing.Sequence[str]] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> PostV10BulkwhoisResponse:
"""
Fetch Live WHOIS information for a list of domains in bulk
Parameters
----------
api_key : str
Your API key
format : typing.Optional[str]
Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.
domain_names : typing.Optional[typing.Sequence[str]]
List of domain names to lookup
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
PostV10BulkwhoisResponse
Successful bulk WHOIS lookup
Examples
--------
from whoisfreaks import AsyncWhoisfreaksApi
import asyncio
client = AsyncWhoisfreaksApi()
async def main() -> None:
await client.bulk_domain_lookup(api_key='apiKey', )
asyncio.run(main())
"""
_response = await self._raw_client.bulk_domain_lookup(
api_key=api_key, format=format, domain_names=domain_names, request_options=request_options
)
return _response.data
async def ip_whois_lookup(
self,
*,
api_key: str,
ip: str,
format: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> GetV10IpWhoisResponse:
"""
Retrieve real-time information for an IPv4 or IPv6 address
Parameters
----------
api_key : str
Your API key
ip : str
The IPv4 or IPv6 for lookup
format : typing.Optional[str]
Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
GetV10IpWhoisResponse
Successful lookup
Examples
--------
from whoisfreaks import AsyncWhoisfreaksApi
import asyncio
client = AsyncWhoisfreaksApi()
async def main() -> None:
await client.ip_whois_lookup(api_key='apiKey', ip='ip', )
asyncio.run(main())
"""
_response = await self._raw_client.ip_whois_lookup(
api_key=api_key, ip=ip, format=format, request_options=request_options
)
return _response.data
async def asn_lookup(
self,
*,
api_key: str,
asn: str,
format: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> GetV10AsnWhoisResponse:
"""
Retrieve real-time information for an Autonomous System Number
Parameters
----------
api_key : str
Your API key
asn : str
The ASN number for which information is being requested (e.g., "1" or "AS1").
format : typing.Optional[str]
Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
GetV10AsnWhoisResponse
Successful lookup
Examples
--------
from whoisfreaks import AsyncWhoisfreaksApi
import asyncio
client = AsyncWhoisfreaksApi()
async def main() -> None:
await client.asn_lookup(api_key='apiKey', asn='asn', )
asyncio.run(main())
"""
_response = await self._raw_client.asn_lookup(
api_key=api_key, asn=asn, format=format, request_options=request_options
)
return _response.data
async def ssl_live_lookup(
self,
*,
api_key: str,
domain_name: str,
chain: typing.Optional[bool] = None,
ssl_raw: typing.Optional[bool] = None,
format: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> GetV10SslLiveResponse:
"""
Retrieve live SSL information for a specific domain.
Parameters
----------
api_key : str
Your API key
domain_name : str
The domain name for which live SSL information is requested (e.g., "example.com").
chain : typing.Optional[bool]
A boolean flag indicating whether to include SSL certificate chain information.
ssl_raw : typing.Optional[bool]
A boolean flag indicating whether to include raw SSL certificate information.
format : typing.Optional[str]
Two formats are available JSON, XML. If you don't specify the 'format' parameter, the default format will be JSON.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
GetV10SslLiveResponse
Successful lookup
Examples
--------
from whoisfreaks import AsyncWhoisfreaksApi
import asyncio
client = AsyncWhoisfreaksApi()
async def main() -> None:
await client.ssl_live_lookup(api_key='apiKey', domain_name='domainName', )
asyncio.run(main())
"""
_response = await self._raw_client.ssl_live_lookup(
api_key=api_key,
domain_name=domain_name,
chain=chain,
ssl_raw=ssl_raw,
format=format,
request_options=request_options,
)
return _response.data
async def domain_availability_lookup(
self,
*,
api_key: str,
domain: str,
sug: typing.Optional[bool] = None,
count: typing.Optional[int] = None,
format: typing.Optional[str] = None,
source: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> GetV10DomainAvailabilityResponse:
"""
Check availability of a Domain Name.
Parameters
----------
api_key : str
Your API key
domain : str
The domain name for which availability is being checked.
sug : typing.Optional[bool]
A boolean flag indicating whether suggested domains are included.
count : typing.Optional[int]
The number of suggested domains to return.