VOOZH about

URL: https://docs.apify.com/platform/proxy

⇱ Proxy | Platform | Apify Documentation


Skip to main content

Proxy

Copy for LLM

Apify Proxy allows you to change your IP address when web scraping to reduce the chance of being blocked because of your geographical location.

You can use proxies in your Actors or any other application that supports HTTP proxies. Apify Proxy monitors the health of your IP pool and intelligently rotates addresses to prevent IP address-based blocking.

You can view your proxy settings and password on the Proxy page in Apify Console. For pricing information, visit apify.com/pricing.

Quickstart

Usage of Apify Proxy means just a couple of lines of code, thanks to the Apify SDKs:

  • JavaScript SDK with PuppeteerCrawler
  • Python SDK with requests
import{Actor}from'apify';
import{PuppeteerCrawler}from'crawlee';

awaitActor.init();

const proxyConfiguration =awaitActor.createProxyConfiguration();

const crawler =newPuppeteerCrawler({
proxyConfiguration,
asyncrequestHandler({ page }){
console.log(await page.content());
},
});

await crawler.run(['https://proxy.apify.com/?format=json']);

awaitActor.exit();
import requests, asyncio
from apify import Actor

asyncdefmain():
asyncwith Actor:
proxy_configuration =await Actor.create_proxy_configuration()
proxy_url =await proxy_configuration.new_url()

proxies ={
'http': proxy_url,
'https': proxy_url,
}

response = requests.get('https://api.apify.com/v2/browser-info', proxies=proxies)
print(response.text)

if __name__ =='__main__':
asyncio.run(main())

Proxy types

Several types of proxy servers exist, each offering distinct advantages, disadvantages, and varying pricing structures. You can use them to access websites from various geographies and with different levels of anonymity.