@@ -64,6 +64,7 @@ def __init__(
64
64
token : str | None = None ,
65
65
* ,
66
66
api_url : str | None = None ,
67
+ api_public_url : str | None = None ,
67
68
max_retries : int | None = 8 ,
68
69
min_delay_between_retries_millis : int | None = 500 ,
69
70
timeout_secs : int | None = DEFAULT_TIMEOUT ,
@@ -72,7 +73,10 @@ def __init__(
72
73
73
74
Args:
74
75
token: The Apify API token.
75
- api_url: The URL of the Apify API server to which to connect to. Defaults to https://api.apify.com.
76
+ api_url: The URL of the Apify API server to which to connect to. Defaults to https://api.apify.com. It can
77
+ be internal url that is not globally accessible, in such case `api_public_url` should be set as well.
78
+ api_public_url: The globally accessible URL of the Apify API server. It should be set only if the `api_url`
79
+ is internal url that is not globally accessible.
76
80
max_retries: How many times to retry a failed request at most.
77
81
min_delay_between_retries_millis: How long will the client wait between retrying requests
78
82
(increases exponentially from this value).
@@ -81,6 +85,7 @@ def __init__(
81
85
self .token = token
82
86
api_url = (api_url or DEFAULT_API_URL ).rstrip ('/' )
83
87
self .base_url = f'{ api_url } /{ API_VERSION } '
88
+ self .public_base_url = (api_public_url or self .base_url ).rstrip ('/' )
84
89
self .max_retries = max_retries or 8
85
90
self .min_delay_between_retries_millis = min_delay_between_retries_millis or 500
86
91
self .timeout_secs = timeout_secs or DEFAULT_TIMEOUT
@@ -103,6 +108,7 @@ def __init__(
103
108
token : str | None = None ,
104
109
* ,
105
110
api_url : str | None = None ,
111
+ api_public_url : str | None = None ,
106
112
max_retries : int | None = 8 ,
107
113
min_delay_between_retries_millis : int | None = 500 ,
108
114
timeout_secs : int | None = DEFAULT_TIMEOUT ,
@@ -111,7 +117,10 @@ def __init__(
111
117
112
118
Args:
113
119
token: The Apify API token.
114
- api_url: The URL of the Apify API server to which to connect to. Defaults to https://api.apify.com.
120
+ api_url: The URL of the Apify API server to which to connect to. Defaults to https://api.apify.com. It can
121
+ be internal url that is not globally accessible, in such case `api_public_url` should be set as well.
122
+ api_public_url: The globally accessible URL of the Apify API server. It should be set only if the `api_url`
123
+ is internal url that is not globally accessible.
115
124
max_retries: How many times to retry a failed request at most.
116
125
min_delay_between_retries_millis: How long will the client wait between retrying requests
117
126
(increases exponentially from this value).
@@ -120,6 +129,7 @@ def __init__(
120
129
super ().__init__ (
121
130
token ,
122
131
api_url = api_url ,
132
+ api_public_url = api_public_url ,
123
133
max_retries = max_retries ,
124
134
min_delay_between_retries_millis = min_delay_between_retries_millis ,
125
135
timeout_secs = timeout_secs ,
@@ -286,6 +296,7 @@ def __init__(
286
296
token : str | None = None ,
287
297
* ,
288
298
api_url : str | None = None ,
299
+ api_public_url : str | None = None ,
289
300
max_retries : int | None = 8 ,
290
301
min_delay_between_retries_millis : int | None = 500 ,
291
302
timeout_secs : int | None = DEFAULT_TIMEOUT ,
@@ -294,7 +305,10 @@ def __init__(
294
305
295
306
Args:
296
307
token: The Apify API token.
297
- api_url: The URL of the Apify API server to which to connect to. Defaults to https://api.apify.com.
308
+ api_url: The URL of the Apify API server to which to connect to. Defaults to https://api.apify.com. It can
309
+ be internal url that is not globally accessible, in such case `api_public_url` should be set as well.
310
+ api_public_url: The globally accessible URL of the Apify API server. It should be set only if the `api_url`
311
+ is internal url that is not globally accessible.
298
312
max_retries: How many times to retry a failed request at most.
299
313
min_delay_between_retries_millis: How long will the client wait between retrying requests
300
314
(increases exponentially from this value).
@@ -303,6 +317,7 @@ def __init__(
303
317
super ().__init__ (
304
318
token ,
305
319
api_url = api_url ,
320
+ api_public_url = api_public_url ,
306
321
max_retries = max_retries ,
307
322
min_delay_between_retries_millis = min_delay_between_retries_millis ,
308
323
timeout_secs = timeout_secs ,
0 commit comments