@@ -37,6 +37,13 @@ export class Proxies extends APIResource {
3737 headers : buildHeaders ( [ { Accept : '*/*' } , options ?. headers ] ) ,
3838 } ) ;
3939 }
40+
41+ /**
42+ * Run a health check on the proxy to verify it's working.
43+ */
44+ check ( id : string , options ?: RequestOptions ) : APIPromise < ProxyCheckResponse > {
45+ return this . _client . post ( path `/proxies/${ id } /check` , options ) ;
46+ }
4047}
4148
4249/**
@@ -703,6 +710,226 @@ export namespace ProxyListResponse {
703710 }
704711}
705712
713+ /**
714+ * Configuration for routing traffic through a proxy.
715+ */
716+ export interface ProxyCheckResponse {
717+ /**
718+ * Proxy type to use. In terms of quality for avoiding bot-detection, from best to
719+ * worst: `mobile` > `residential` > `isp` > `datacenter`.
720+ */
721+ type : 'datacenter' | 'isp' | 'residential' | 'mobile' | 'custom' ;
722+
723+ id ?: string ;
724+
725+ /**
726+ * Configuration specific to the selected proxy `type`.
727+ */
728+ config ?:
729+ | ProxyCheckResponse . DatacenterProxyConfig
730+ | ProxyCheckResponse . IspProxyConfig
731+ | ProxyCheckResponse . ResidentialProxyConfig
732+ | ProxyCheckResponse . MobileProxyConfig
733+ | ProxyCheckResponse . CustomProxyConfig ;
734+
735+ /**
736+ * Timestamp of the last health check performed on this proxy.
737+ */
738+ last_checked ?: string ;
739+
740+ /**
741+ * Readable name of the proxy.
742+ */
743+ name ?: string ;
744+
745+ /**
746+ * Protocol to use for the proxy connection.
747+ */
748+ protocol ?: 'http' | 'https' ;
749+
750+ /**
751+ * Current health status of the proxy.
752+ */
753+ status ?: 'available' | 'unavailable' ;
754+ }
755+
756+ export namespace ProxyCheckResponse {
757+ /**
758+ * Configuration for a datacenter proxy.
759+ */
760+ export interface DatacenterProxyConfig {
761+ /**
762+ * ISO 3166 country code. Defaults to US if not provided.
763+ */
764+ country ?: string ;
765+ }
766+
767+ /**
768+ * Configuration for an ISP proxy.
769+ */
770+ export interface IspProxyConfig {
771+ /**
772+ * ISO 3166 country code. Defaults to US if not provided.
773+ */
774+ country ?: string ;
775+ }
776+
777+ /**
778+ * Configuration for residential proxies.
779+ */
780+ export interface ResidentialProxyConfig {
781+ /**
782+ * Autonomous system number. See https://bgp.potaroo.net/cidr/autnums.html
783+ */
784+ asn ?: string ;
785+
786+ /**
787+ * City name (no spaces, e.g. `sanfrancisco`). If provided, `country` must also be
788+ * provided.
789+ */
790+ city ?: string ;
791+
792+ /**
793+ * ISO 3166 country code.
794+ */
795+ country ?: string ;
796+
797+ /**
798+ * @deprecated Operating system of the residential device.
799+ */
800+ os ?: 'windows' | 'macos' | 'android' ;
801+
802+ /**
803+ * Two-letter state code.
804+ */
805+ state ?: string ;
806+
807+ /**
808+ * US ZIP code.
809+ */
810+ zip ?: string ;
811+ }
812+
813+ /**
814+ * Configuration for mobile proxies.
815+ */
816+ export interface MobileProxyConfig {
817+ /**
818+ * Autonomous system number. See https://bgp.potaroo.net/cidr/autnums.html
819+ */
820+ asn ?: string ;
821+
822+ /**
823+ * Mobile carrier.
824+ */
825+ carrier ?:
826+ | 'a1'
827+ | 'aircel'
828+ | 'airtel'
829+ | 'att'
830+ | 'celcom'
831+ | 'chinamobile'
832+ | 'claro'
833+ | 'comcast'
834+ | 'cox'
835+ | 'digi'
836+ | 'dt'
837+ | 'docomo'
838+ | 'dtac'
839+ | 'etisalat'
840+ | 'idea'
841+ | 'kyivstar'
842+ | 'meo'
843+ | 'megafon'
844+ | 'mtn'
845+ | 'mtnza'
846+ | 'mts'
847+ | 'optus'
848+ | 'orange'
849+ | 'qwest'
850+ | 'reliance_jio'
851+ | 'robi'
852+ | 'sprint'
853+ | 'telefonica'
854+ | 'telstra'
855+ | 'tmobile'
856+ | 'tigo'
857+ | 'tim'
858+ | 'verizon'
859+ | 'vimpelcom'
860+ | 'vodacomza'
861+ | 'vodafone'
862+ | 'vivo'
863+ | 'zain'
864+ | 'vivabo'
865+ | 'telenormyanmar'
866+ | 'kcelljsc'
867+ | 'swisscom'
868+ | 'singtel'
869+ | 'asiacell'
870+ | 'windit'
871+ | 'cellc'
872+ | 'ooredoo'
873+ | 'drei'
874+ | 'umobile'
875+ | 'cableone'
876+ | 'proximus'
877+ | 'tele2'
878+ | 'mobitel'
879+ | 'o2'
880+ | 'bouygues'
881+ | 'free'
882+ | 'sfr'
883+ | 'digicel' ;
884+
885+ /**
886+ * City name (no spaces, e.g. `sanfrancisco`). If provided, `country` must also be
887+ * provided.
888+ */
889+ city ?: string ;
890+
891+ /**
892+ * ISO 3166 country code
893+ */
894+ country ?: string ;
895+
896+ /**
897+ * Two-letter state code.
898+ */
899+ state ?: string ;
900+
901+ /**
902+ * US ZIP code.
903+ */
904+ zip ?: string ;
905+ }
906+
907+ /**
908+ * Configuration for a custom proxy (e.g., private proxy server).
909+ */
910+ export interface CustomProxyConfig {
911+ /**
912+ * Proxy host address or IP.
913+ */
914+ host : string ;
915+
916+ /**
917+ * Proxy port.
918+ */
919+ port : number ;
920+
921+ /**
922+ * Whether the proxy has a password.
923+ */
924+ has_password ?: boolean ;
925+
926+ /**
927+ * Username for proxy authentication.
928+ */
929+ username ?: string ;
930+ }
931+ }
932+
706933export interface ProxyCreateParams {
707934 /**
708935 * Proxy type to use. In terms of quality for avoiding bot-detection, from best to
@@ -913,6 +1140,7 @@ export declare namespace Proxies {
9131140 type ProxyCreateResponse as ProxyCreateResponse ,
9141141 type ProxyRetrieveResponse as ProxyRetrieveResponse ,
9151142 type ProxyListResponse as ProxyListResponse ,
1143+ type ProxyCheckResponse as ProxyCheckResponse ,
9161144 type ProxyCreateParams as ProxyCreateParams ,
9171145 } ;
9181146}
0 commit comments