Skip to main content
Version: 2.7

ProxyConfiguration

{"content": ["Configures a connection to a proxy server with the provided options.\n\nProxy servers are used to prevent target websites from blocking your crawlers based on IP address rate limits or\nblacklists. The default servers used by this class are managed by Apify Proxy.\nTo be able to use Apify Proxy, you need an Apify account and access to the selected proxies. If you provide\nno configuration option, the proxies will be managed automatically using a smart algorithm.\n\nIf you want to use your own proxies, use the proxy_urls or new_url_function constructor options. Your list\nof proxy URLs will be rotated by the configuration, if this option is provided."]}

Index

Methods

initialize

  • async initialize(): None
  • {"content": ["Check if using proxy, if so, check the access.\n\nLoad the Apify Proxy password from API (only if not passed to constructor or through env var).\n\nOnly called if Apify Proxy configuration is used. Also checks if country has access to Apify Proxy groups\nif the country code is provided.\n\nYou should use the Actor.create_proxy_configuration function to create a pre-initialized\nProxyConfiguration instance instead of calling this manually."]}


    Returns None

new_proxy_info

  • async new_proxy_info(session_id, request, proxy_tier): ProxyInfo | None
  • {"content": ["Create a new ProxyInfo object.\n\nUse it if you want to work with a rich representation of a proxy URL. If you need the URL string only,\nuse ProxyConfiguration.new_url.\n", {"


    Parameters

    • session_id: str | None = None
    • request: Request | None = None
    • proxy_tier: int | None = None

    Returns ProxyInfo | None

Page Options