Skip to main content
Version: 1.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 blacklists.\nThe 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 no configuration option,\nthe 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.\nYour list of proxy URLs will be rotated by the configuration, if this option is provided."]}

Index

Methods

initialize

  • async initialize(): None
  • {"content": ["Load the Apify Proxy password if the API token is provided and check access to Apify Proxy and provided proxy groups.\n\nOnly called if Apify Proxy configuration is used.\nAlso checks if country has access to Apify Proxy groups if the country code is provided.\n\nYou should use the Actor.create_proxy_configuration function\nto create a pre-initialized ProxyConfiguration instance instead of calling this manually."]}


    Returns None

new_proxy_info

  • {"content": ["Create a new ProxyInfo object.\n\nUse it if you want to work with a rich representation of a proxy URL.\nIf you need the URL string only, use ProxyConfiguration.new_url.\n", {"


    Parameters

    • session_id: int | str | None = None

    Returns ProxyInfo

new_url

  • async new_url(session_id): str
  • {"content": ["Return a new proxy URL based on provided configuration options and the sessionId parameter.\n", {"


    Parameters

    • session_id: int | str | None = None

    Returns str

Page Options