<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Scrapfly</title>
    <description>The latest articles on DEV Community by Scrapfly (@scrapfly_dev).</description>
    <link>https://dev.to/scrapfly_dev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1062587%2Ff7fc57f0-9e47-4530-8449-8ad7085558df.jpg</url>
      <title>DEV Community: Scrapfly</title>
      <link>https://dev.to/scrapfly_dev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/scrapfly_dev"/>
    <language>en</language>
    <item>
      <title>How to Optimize Oxylabs Proxies</title>
      <dc:creator>Scrapfly</dc:creator>
      <pubDate>Thu, 08 May 2025 10:21:04 +0000</pubDate>
      <link>https://dev.to/scrapfly_dev/how-to-optimize-oxylabs-proxies-3a03</link>
      <guid>https://dev.to/scrapfly_dev/how-to-optimize-oxylabs-proxies-3a03</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb1o3741yi2efbk6gba71.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb1o3741yi2efbk6gba71.webp" alt="How to Optimize Oxylabs Proxies: A Complete Guide with Python and Scrapfly" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Proxies are indispensable tools for web scraping, data aggregation, and maintaining online anonymity. By routing internet traffic through intermediary servers, proxies mask users' IP addresses and facilitate access to geo-restricted content. Among the myriad of proxy providers, Oxylabs stands out for its robust infrastructure and extensive proxy pool.&lt;/p&gt;

&lt;p&gt;However, effectively leveraging Oxylabs proxies necessitates a clear understanding of their setup and optimization techniques. This guide delves into the essentials of Oxylabs proxies, from account creation to bandwidth optimization using Python and Scrapfly's Proxy Saver.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Proxies and Their Importance
&lt;/h2&gt;

&lt;p&gt;Proxies act as intermediaries between a user's device and the internet, playing a pivotal role in scenarios requiring anonymity, bypassing geo-restrictions, or managing multiple accounts. The primary types of proxies include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Datacenter Proxies&lt;/strong&gt; : Not affiliated with Internet Service Providers (ISPs), offering high speed and cost-effectiveness.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Residential Proxies&lt;/strong&gt; : Sourced from real users' devices, providing higher anonymity and a lower likelihood of being blocked.([Oxylabs][1])&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ISP Proxies&lt;/strong&gt; : Combining the benefits of datacenter and residential proxies, offering both speed and legitimacy.([Oxylabs][2])&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Utilizing proxies is crucial for tasks like web scraping, where accessing large volumes of data without being blocked is essential.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction to Oxylabs
&lt;/h2&gt;

&lt;p&gt;Oxylabs is a premium proxy service provider offering a vast pool of residential, datacenter, and mobile proxies. With over 100 million IPs globally, Oxylabs caters to businesses requiring reliable and scalable proxy solutions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Oxylabs Free Trial
&lt;/h3&gt;

&lt;p&gt;Oxylabs provides a free trial for its residential and datacenter proxies, allowing users to test their services before committing. This trial is particularly beneficial for businesses evaluating proxy solutions for their specific needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up Your Oxylabs Proxy
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Account Creation
&lt;/h3&gt;

&lt;p&gt;Begin by visiting &lt;a href="https://oxylabs.io" rel="noopener noreferrer"&gt;Oxylabs&lt;/a&gt; and signing up using your business email. Complete the verification process as prompted.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Accessing the Dashboard
&lt;/h3&gt;

&lt;p&gt;Upon successful registration, log in to your Oxylabs dashboard. Navigate through the dashboard to manage your proxies and monitor usage.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Generating Proxy Credentials
&lt;/h3&gt;

&lt;p&gt;Select the type of proxy (residential or datacenter) you wish to use. Choose your authentication method: either username/password or IP whitelisting. Note down your proxy endpoint and port for configuration.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Testing Your Proxy
&lt;/h3&gt;

&lt;p&gt;To verify your proxy setup, you can use the following cURL command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -k --proxy http://USERNAME:PASSWORD@dc.oxylabs.io:8000 https://httpbin.dev/anything

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command sends a request through the Oxylabs proxy and returns the response, confirming successful configuration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fetching Data Using Oxylabs Proxies
&lt;/h2&gt;

&lt;p&gt;Once your proxy is set up, you can use it to fetch data from websites. Here's an example using Python's &lt;code&gt;requests&lt;/code&gt; library:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests

url = "https://example.com/product-page"

headers = {
    "User-Agent": "Mozilla/5.0",
    "Accept-Encoding": "gzip, deflate",
}

proxies = {
    "http": "http://username:password@dc.oxylabs.io:8000",
    "https": "http://username:password@dc.oxylabs.io:8000",
}

response = requests.get(url, headers=headers, proxies=proxies)
print(response.text)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This script fetches the content of the specified URL through the Oxylabs proxy, using headers to mimic a regular browser request.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Reduce Bandwidth Usage with Oxylabs Proxies
&lt;/h2&gt;

&lt;p&gt;Optimizing bandwidth usage is crucial when dealing with large-scale data scraping. Here are several techniques to minimize bandwidth consumption, each explained with a short rationale and example.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Set Lightweight Request Headers
&lt;/h3&gt;

&lt;p&gt;Use minimal headers to request only the essential parts of a webpage and avoid loading additional scripts or rich content.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;headers = {
    "User-Agent": "Mozilla/5.0",
    "Accept": "text/html",
    "Accept-Encoding": "gzip, deflate",
    "Connection": "close"
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This reduces the size of the server's response by excluding multimedia and encouraging text-only output with compression enabled.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Use HEAD Requests for Validation
&lt;/h3&gt;

&lt;p&gt;HEAD requests are ideal when you only need to check if a page exists, as they return headers without a full page download.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;response = requests.head("https://example.com/page", proxies=proxies, headers=headers)
print("Status code:", response.status_code)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This avoids downloading the entire response body, saving bandwidth while confirming availability.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Disable Loading of Images and Scripts
&lt;/h3&gt;

&lt;p&gt;Blocking media and JavaScript resources can significantly reduce page load times and bandwidth usage when scraping.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument("--headless")
prefs = {
    "profile.managed_default_content_settings.images": 2,
    "profile.managed_default_content_settings.javascript": 2
}
options.add_experimental_option("prefs", prefs)

driver = webdriver.Chrome(options=options)
driver.get("https://example.com")
print(driver.page_source)
driver.quit()

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This ensures only the HTML content is loaded, drastically reducing the payload size.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Limit Pagination
&lt;/h3&gt;

&lt;p&gt;Instead of scraping thousands of pages, limit the number of pages to avoid excessive data retrieval.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for page in range(1, 6):
    url = f"https://example.com/products?page={page}"
    response = requests.get(url, headers=headers, proxies=proxies)
    print(f"Page {page} status:", response.status_code)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Limiting pagination helps manage total request volume and reduces unnecessary bandwidth consumption.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Extract Specific Content
&lt;/h3&gt;

&lt;p&gt;Parse only the content you need from HTML responses to avoid processing or storing irrelevant data.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from lxml import html

tree = html.fromstring(response.content)
titles = tree.xpath('//h2[@class="product-title"]/text()')
print(titles)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This approach focuses on extracting specific fields, improving memory efficiency and speed.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Utilize Query Parameters
&lt;/h3&gt;

&lt;p&gt;Take advantage of API or URL parameters to narrow results and minimize the returned dataset size.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;url = "https://example.com/api/search?query=laptop&amp;amp;limit=5"
response = requests.get(url, headers=headers, proxies=proxies)
print(response.json())

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This limits the server's response to a small, relevant subset, which is ideal for lean scraping operations.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Disable Redirects
&lt;/h3&gt;

&lt;p&gt;Avoid following multiple redirects, especially those used by CDNs and tracking systems, to cut down on extra HTTP requests.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;response = requests.get("https://example.com", headers=headers, proxies=proxies, allow_redirects=False)
print(response.status_code, response.headers.get("Location"))

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This saves both time and bandwidth by halting at the initial response instead of continuing through redirection chains.&lt;/p&gt;

&lt;h3&gt;
  
  
  8. Implement Timeouts
&lt;/h3&gt;

&lt;p&gt;Set a short timeout to quickly drop stalled or slow requests that would otherwise waste bandwidth and delay scraping.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;try:
    response = requests.get("https://example.com", headers=headers, proxies=proxies, timeout=5)
    print(response.status_code)
except requests.exceptions.Timeout:
    print("Request timed out")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This ensures your scraping pipeline remains responsive and doesn't hang on slow-loading pages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enhancing Proxy Efficiency with Scrapfly Proxy Saver
&lt;/h2&gt;

&lt;p&gt;Scrapfly's Proxy Saver is a middleware solution designed to optimize proxy usage by reducing bandwidth and improving stability. It offers features like automatic caching, fingerprint impersonation, and blocking of unnecessary resources.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests

params = {
    "url": "https://example.com",
    "proxy": "oxylabs",
    "country": "us",
    "block_assets": "true"
}

headers = {"X-API-Key": "your_scrapfly_api_key"}

response = requests.get("https://api.scrapfly.io/scrape", headers=headers, params=params)
print(response.json())

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This setup routes your request through Scrapfly's Proxy Saver, which then uses your Oxylabs proxy, applying optimizations to reduce bandwidth usage.&lt;/p&gt;

&lt;p&gt;Certainly! Here's the &lt;strong&gt;continuation and completion&lt;/strong&gt; of the article, maintaining the format and enhancements you've requested:&lt;/p&gt;




&lt;h2&gt;
  
  
  Comparing Oxylabs and Bright Data
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Oxylabs&lt;/th&gt;
&lt;th&gt;Bright Data&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;IP Pool&lt;/td&gt;
&lt;td&gt;100M+&lt;/td&gt;
&lt;td&gt;72M+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Free Trial&lt;/td&gt;
&lt;td&gt;5 datacenter IPs&lt;/td&gt;
&lt;td&gt;Limited usage quota&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bandwidth Control&lt;/td&gt;
&lt;td&gt;Manual + Scrapfly Integration&lt;/td&gt;
&lt;td&gt;Requires proxy manager&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dashboard UX&lt;/td&gt;
&lt;td&gt;Modern and intuitive&lt;/td&gt;
&lt;td&gt;Advanced but more complex&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Developer Tools&lt;/td&gt;
&lt;td&gt;Simple proxy strings, API docs&lt;/td&gt;
&lt;td&gt;Proxy Manager, APIs, CLI tools&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Both providers are powerful, but Oxylabs' straightforward setup and compatibility with tools like Scrapfly make it an excellent choice for efficient, high-scale scraping.&lt;/p&gt;

&lt;p&gt;You can read our Bright Data optimization guide for a detailed walkthrough on tuning their proxies:&lt;/p&gt;

&lt;p&gt;[&lt;/p&gt;

&lt;p&gt;How to Reduce Your Bright Data Bandwidth Usage&lt;/p&gt;

&lt;p&gt;Learn the most effective ways to reduce Bright Data costs with bandwidth-saving techniques and streamlined proxy settings.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6v6j2mlnz0rriv5ww4mk.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6v6j2mlnz0rriv5ww4mk.webp" alt="How to Optimize Oxylabs Proxies: A Complete Guide with Python and Scrapfly" width="800" height="419"&gt;&lt;/a&gt;&lt;br&gt;
](&lt;a href="https://scrapfly.io/blog/how-to-reduce-your-bright-data-bandwidth-usage/" rel="noopener noreferrer"&gt;https://scrapfly.io/blog/how-to-reduce-your-bright-data-bandwidth-usage/&lt;/a&gt;)&lt;/p&gt;
&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;
&lt;h3&gt;
  
  
  What’s the best way to test Oxylabs proxies?
&lt;/h3&gt;

&lt;p&gt;You can use tools like cURL or Python scripts to confirm connectivity. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -k --proxy http://USERNAME:PASSWORD@dc.oxylabs.io:8000 https://httpbin.dev/anything

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command routes your request through an Oxylabs datacenter proxy and shows your proxied IP in the response.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does reducing bandwidth affect data accuracy?
&lt;/h3&gt;

&lt;p&gt;Not when done correctly. Headers and content stubbing remove only non-essential assets like ads or scripts, leaving the core data intact.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I combine Oxylabs and Scrapfly in the same project?
&lt;/h3&gt;

&lt;p&gt;Yes, Scrapfly Proxy Saver acts as a proxy wrapper, allowing you to route Oxylabs traffic through their optimization layer for better efficiency.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In this guide, you learned how to set up and optimize Oxylabs proxies for efficient web scraping. We explored the different types of proxies and how to configure them using Python and cURL. To reduce bandwidth, we covered eight practical strategies including lightweight headers, pagination control, asset blocking, and more.&lt;/p&gt;

&lt;p&gt;Finally, we introduced Scrapfly Proxy Saver, a powerful tool to enhance proxy performance through smart routing, fingerprint spoofing, and bandwidth optimization—integrating seamlessly with your Oxylabs setup.&lt;/p&gt;

&lt;p&gt;Whether you’re scraping thousands of product listings or just experimenting with proxy management, these best practices will help you stay efficient, cost-effective, and scalable.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Reduce Your Bright Data Bandwidth Usage</title>
      <dc:creator>Scrapfly</dc:creator>
      <pubDate>Fri, 02 May 2025 13:33:12 +0000</pubDate>
      <link>https://dev.to/scrapfly_dev/how-to-reduce-your-bright-data-bandwidth-usage-o8n</link>
      <guid>https://dev.to/scrapfly_dev/how-to-reduce-your-bright-data-bandwidth-usage-o8n</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6v6j2mlnz0rriv5ww4mk.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6v6j2mlnz0rriv5ww4mk.webp" alt="How to Reduce Your Bright Data Bandwidth Usage" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://brightdata.com/" rel="noopener noreferrer"&gt;Bright Data&lt;/a&gt; is a top-tier proxy provider—but its bandwidth costs can escalate quickly if not carefully managed. Whether you're scraping product pages, monitoring SEO trends, or extracting social media data, excessive proxy traffic can burn through your budget. That’s why learning to monitor, optimize, and enhance your proxy setup is vital to efficient operations.&lt;/p&gt;

&lt;p&gt;This guide will walk you through reducing your Bright Data bandwidth usage by first optimizing proxy requests using plain Python, and then showing how to supercharge efficiency using &lt;a href="https://scrapfly.io/proxy-saver" rel="noopener noreferrer"&gt;Scrapfly Proxy Saver&lt;/a&gt;. We'll cover everything from understanding Bright Data's proxy types, to tuning your scripts, to applying advanced optimizations with minimal configuration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding and Creating a Bright Data Proxy
&lt;/h2&gt;

&lt;p&gt;Bright Data proxies come in several types—residential, datacenter, ISP, and mobile—each tailored for different scraping environments. Residential proxies mimic real users by routing requests through real devices, offering high stealth. Datacenter proxies offer better performance at a lower cost but are more detectable.&lt;/p&gt;

&lt;p&gt;To start using a Bright Data proxy, you first need to create a zone:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://brd-customer-USERNAME-zone-ZONENAME:PASSWORD@brd.superproxy.io:PORT

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Steps to Create a Proxy Zone:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Log in to your &lt;a href="https://brightdata.com/" rel="noopener noreferrer"&gt;Bright Data dashboard&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Navigate to &lt;strong&gt;Proxy Zones&lt;/strong&gt; and click &lt;strong&gt;Add Zone&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Choose the desired proxy type: Residential, Datacenter, ISP, or Mobile.&lt;/li&gt;
&lt;li&gt;Customize parameters such as rotation strategy, country targeting, and session persistence.&lt;/li&gt;
&lt;li&gt;Copy the generated credentials and use them in your scraping scripts.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These proxy zones determine how your traffic is routed and how you're billed for bandwidth and requests. Understanding the differences between each type helps you choose the most cost-effective and appropriate one for your scraping goals.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Bright Data Proxies in Python
&lt;/h2&gt;

&lt;p&gt;After creating your zone, you’ll receive a formatted proxy URL. You can use this with Python's standard &lt;code&gt;urllib&lt;/code&gt; module for basic requests:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import urllib.request

proxy = 'http://brd-customer-USERNAME-zone-ZONENAME:PASSWORD@brd.superproxy.io:22225'
url = 'https://scrapfly.io/proxy-saver'

opener = urllib.request.build_opener(
    urllib.request.ProxyHandler({'http': proxy, 'https': proxy})
)

try:
    response = opener.open(url)
    print(response.read().decode())
except Exception as e:
    print(f"Error: {e}")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This setup ensures that all HTTP and HTTPS requests are routed through your configured Bright Data proxy. However, each request will include full page payloads, images, and headers—leading to significant bandwidth usage if not controlled.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reducing Bandwidth in Python
&lt;/h2&gt;

&lt;p&gt;Python gives you granular control over your requests. Here's how you can reduce overhead before reaching for external tools:&lt;/p&gt;

&lt;h3&gt;
  
  
  Reuse Connections with Sessions
&lt;/h3&gt;

&lt;p&gt;Using a &lt;code&gt;requests.Session()&lt;/code&gt; object maintains a persistent connection across multiple requests:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests

session = requests.Session()
session.proxies.update({
    'http': proxy,
    'https': proxy
})

for url in ['https://scrapfly.io/proxy-saver', 'https://scrapfly.io/blog/how-to-optimize-proxies/']:
    response = session.get(url)
    print(len(response.content))

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This significantly reduces connection establishment time and redundant TCP handshakes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Request Less Data
&lt;/h3&gt;

&lt;p&gt;You don’t need every byte the server sends. Customize headers to exclude images, scripts, or compress output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;headers = {
    "User-Agent": "Mozilla/5.0",
    "Accept": "text/html",
    "Accept-Encoding": "gzip"
}

response = session.get("https://scrapfly.io/proxy-saver", headers=headers)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Cache Static Responses
&lt;/h3&gt;

&lt;p&gt;If you're visiting static or semi-static pages, cache responses locally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import os, hashlib

def get_cached_response(url):
    filename = f"/tmp/{hashlib.md5(url.encode()).hexdigest()}.cache"
    if os.path.exists(filename):
        with open(filename, 'rb') as f:
            return f.read()
    response = session.get(url)
    with open(filename, 'wb') as f:
        f.write(response.content)
    return response.content

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Caching can reduce bandwidth by up to 90% when working with rarely updated pages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Supercharge with Scrapfly Proxy Saver
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://scrapfly.io/proxy-saver" rel="noopener noreferrer"&gt;Scrapfly Proxy Saver&lt;/a&gt; automates bandwidth-saving strategies without touching your codebase. It functions as a middleware between your scraping script and Bright Data, applying smart compression, routing, and stubbing on the fly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Unlock Bandwidth &amp;amp; Latency Efficiency with Proxy Saver
&lt;/h3&gt;

&lt;p&gt;Proxy Saver is designed for scale. Its optimizations deliver more value as your traffic grows. Even simple scraping tasks benefit from reduced costs and faster responses.&lt;/p&gt;

&lt;h4&gt;
  
  
  Key Features:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Connection reuse to reduce TCP overhead&lt;/li&gt;
&lt;li&gt;Global public caching of common content&lt;/li&gt;
&lt;li&gt;Redirection and CORS caching&lt;/li&gt;
&lt;li&gt;Automatic blocking of telemetry and ad scripts&lt;/li&gt;
&lt;li&gt;Stubbing for large media like images and CSS&lt;/li&gt;
&lt;li&gt;Optimized TLS handshake and TCP connection pooling&lt;/li&gt;
&lt;li&gt;DNS pre-warming for quick domain resolution&lt;/li&gt;
&lt;li&gt;Failover and retry logic for higher reliability&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of these features are activated by default, but you can fine-tune behavior using parameters in the proxy username.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example Integration with Python
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests

proxy = {
    'http': 'http://proxyId-abc123-Timeout-10-FpImpersonate-chrome_win_130@proxy-saver.scrapfly.io:3333',
    'https': 'http://proxyId-abc123-Timeout-10-FpImpersonate-chrome_win_130@proxy-saver.scrapfly.io:3333'
}

response = requests.get('https://httpbin.dev/anything', proxies=proxy, verify=False)
print(response.json())

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Configuration Options
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameter&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;proxyId&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Required ID from your dashboard&lt;/td&gt;
&lt;td&gt;&lt;code&gt;proxyId-abc123&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Timeout&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Request timeout in seconds&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Timeout-10&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FpImpersonate&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fingerprint of a real browser&lt;/td&gt;
&lt;td&gt;&lt;code&gt;FpImpersonate-chrome_win_130&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DisableImageStub&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Load full images instead of 1x1 pixel&lt;/td&gt;
&lt;td&gt;&lt;code&gt;DisableImageStub-True&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DisableCssStub&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Load real CSS files&lt;/td&gt;
&lt;td&gt;&lt;code&gt;DisableCssStub-True&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;allowRetry&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Disable automatic retry on failure&lt;/td&gt;
&lt;td&gt;&lt;code&gt;allowRetry-False&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;intermediateResourceMaxSize&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Max resource size in MB&lt;/td&gt;
&lt;td&gt;&lt;code&gt;intermediateResourceMaxSize-4&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Combine multiple settings like: &lt;code&gt;proxyId-xyz-FpImpersonate-chrome_win_130-Timeout-8&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Passing Parameters to Bright Data
&lt;/h3&gt;

&lt;p&gt;Use the &lt;code&gt;|&lt;/code&gt; separator to pass downstream proxy config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;proxyId-abc123|country-us:API_KEY@proxy-saver.scrapfly.io:3333

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This allows full control over Scrapfly optimization and Bright Data zone behavior simultaneously.&lt;/p&gt;

&lt;h3&gt;
  
  
  Special Note on Rotating IPs
&lt;/h3&gt;

&lt;p&gt;If you're using Bright Data with session rotation, enable the "Rotating Proxy" mode in Scrapfly’s dashboard to ensure traffic patterns are preserved and connection optimizations are adjusted accordingly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Proxy Types
&lt;/h2&gt;

&lt;p&gt;Choosing the right proxy type is just as important as using it efficiently. Each scraping scenario benefits from different proxy capabilities, and making the right selection can greatly impact your results.&lt;/p&gt;

&lt;h3&gt;
  
  
  Residential Proxies
&lt;/h3&gt;

&lt;p&gt;Residential proxies use IP addresses provided by ISPs and linked to physical locations. They offer excellent authenticity and are ideal for accessing geo-blocked or sensitive content. However, they tend to be more expensive and should be used judiciously.&lt;/p&gt;

&lt;p&gt;You can checkout our article about residential proxies:&lt;/p&gt;

&lt;p&gt;[&lt;/p&gt;

&lt;p&gt;Top 5 Residential Proxy Providers for Web Scraping&lt;/p&gt;

&lt;p&gt;Comparison of top residential proxy providers for web scraping. Blocking rates, performance and general overview of what makes a good proxy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Ftop-5-residential-proxy-providers_banner_light.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Ftop-5-residential-proxy-providers_banner_light.svg" alt="How to Reduce Your Bright Data Bandwidth Usage" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
](&lt;a href="https://scrapfly.io/blog/top-5-residential-proxy-providers/" rel="noopener noreferrer"&gt;https://scrapfly.io/blog/top-5-residential-proxy-providers/&lt;/a&gt;)&lt;/p&gt;

&lt;h3&gt;
  
  
  Datacenter Proxies
&lt;/h3&gt;

&lt;p&gt;Datacenter proxies originate from cloud-based data centers. They are fast and cost-effective but easier to detect. They work well for non-sensitive, high-volume tasks where occasional blocks are tolerable.&lt;/p&gt;

&lt;p&gt;You can checkout our article about datacenter proxies:&lt;/p&gt;

&lt;p&gt;[&lt;/p&gt;

&lt;p&gt;The Best Datacenter Proxies in 2025: A Complete Guide&lt;/p&gt;

&lt;p&gt;Explore the best datacenter proxies for 2025 including IPRoyal, shared vs dedicated options, and how to buy unlimited bandwidth proxies.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2F2025%2F03%2Fdatacenter-proxies-white-bg.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2F2025%2F03%2Fdatacenter-proxies-white-bg.svg" alt="How to Reduce Your Bright Data Bandwidth Usage" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
](&lt;a href="https://scrapfly.io/blog/the-best-datacenter-proxies-in-2025-a-complete-guide/" rel="noopener noreferrer"&gt;https://scrapfly.io/blog/the-best-datacenter-proxies-in-2025-a-complete-guide/&lt;/a&gt;)&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQs
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How do I create a Bright Data proxy?
&lt;/h3&gt;

&lt;p&gt;You create a zone in the dashboard, select your proxy type, and configure settings like geo-targeting and session duration.&lt;/p&gt;

&lt;h3&gt;
  
  
  How does Scrapfly Proxy Saver reduce bandwidth?
&lt;/h3&gt;

&lt;p&gt;It compresses data, stubs static content, and caches responses. You can save up to 30% or more on data transfer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I use Proxy Saver with Bright Data?
&lt;/h3&gt;

&lt;p&gt;Yes. Just plug your Bright Data proxy into the Proxy Saver dashboard and route traffic through Scrapfly's endpoint.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Controlling proxy bandwidth usage is crucial for keeping scraping operations efficient and affordable. Start by optimizing your Bright Data usage with smart Python practices—like connection reuse, selective content fetching, and local caching. Then, amplify those gains using Scrapfly Proxy Saver’s powerful middleware that automates compression, fingerprint impersonation, connection reuse, and more.&lt;/p&gt;

&lt;p&gt;Whether you’re scraping a few pages or handling millions of requests per day, these techniques ensure your proxy usage remains fast, efficient, and cost-effective.&lt;/p&gt;

</description>
      <category>proxies</category>
    </item>
    <item>
      <title>What is Rate Limiting? Everything You Need to Know</title>
      <dc:creator>Scrapfly</dc:creator>
      <pubDate>Fri, 02 May 2025 13:33:03 +0000</pubDate>
      <link>https://dev.to/scrapfly_dev/what-is-rate-limiting-everything-you-need-to-know-1mli</link>
      <guid>https://dev.to/scrapfly_dev/what-is-rate-limiting-everything-you-need-to-know-1mli</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn2up1b1j7jlryhcntbtz.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn2up1b1j7jlryhcntbtz.webp" alt="What is Rate Limiting? Everything You Need to Know" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Rate limiting is a vital concept in APIs, web services, and application development. It controls how many requests a user or system can make to a resource within a set time frame, helping ensure system stability, fair access, and protection against abuse like spam or denial-of-service attacks.&lt;/p&gt;

&lt;p&gt;For both developers and beginners, understanding rate limiting is key to building secure and scalable systems. In this guide, we’ll cover what rate limiting is, why it matters, how it works, common algorithms, practical examples, and tips for implementing it effectively.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is an IP Address?
&lt;/h2&gt;

&lt;p&gt;Before diving deeper into rate limiting, it is essential to understand what an IP (Internet Protocol) address is, as rate limiting often involves tracking IPs. An IP address is a unique identifier assigned to each device connected to a network that uses the Internet Protocol for communication. Think of it like a mailing address for your computer or smartphone.&lt;/p&gt;

&lt;p&gt;There are two main types of IP addresses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;IPv4:&lt;/strong&gt; The most commonly used format, consisting of four groups of numbers separated by dots (e.g., 192.168.1.1).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IPv6:&lt;/strong&gt; A newer format designed to accommodate the growing number of internet devices, using eight groups of hexadecimal numbers separated by colons (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;for more details checkout our article:&lt;/p&gt;

&lt;p&gt;[&lt;/p&gt;

&lt;p&gt;What is the difference between IPv4 vs IPv6 in web scraping?&lt;/p&gt;

&lt;p&gt;IPv4 and IPv6 are two competing Internet Protocol version that have different advantages when it comes to web scraping. Here's what they are.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy46h0mj2uai2cjyplnbp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy46h0mj2uai2cjyplnbp.png" alt="What is Rate Limiting? Everything You Need to Know" width="800" height="800"&gt;&lt;/a&gt;&lt;br&gt;
](&lt;a href="https://scrapfly.io/blog/ipv4-vs-ipv6-in-web-scraping/" rel="noopener noreferrer"&gt;https://scrapfly.io/blog/ipv4-vs-ipv6-in-web-scraping/&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;IP addresses allow devices to find and communicate with each other across networks. In rate limiting, systems often monitor requests based on IP addresses to identify and control the source of traffic.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why is Rate Limiting Important?
&lt;/h2&gt;

&lt;p&gt;Without rate limiting, systems are vulnerable to overwhelming traffic that can slow down or crash services. Here are some essential reasons why rate limiting is important:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Prevents Abuse:&lt;/strong&gt; Stops malicious users from spamming or overloading systems.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ensures Fair Use:&lt;/strong&gt; Guarantees that no single user can monopolize resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Protects System Stability:&lt;/strong&gt; Maintains predictable and reliable service.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enhances Security:&lt;/strong&gt; Acts as a defensive mechanism against DDoS attacks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now that you understand its importance, let’s dive into how rate limiting actually works.&lt;/p&gt;
&lt;h2&gt;
  
  
  How Does Rate Limiting Work?
&lt;/h2&gt;

&lt;p&gt;Rate limiting monitors the number of requests from a user, IP address, or API key over a given time window (e.g., 100 requests per minute). If the threshold is exceeded, the system responds with an error code, often HTTP 429 (Too Many Requests).&lt;/p&gt;

&lt;p&gt;Rate limiters can be implemented at different layers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Application Layer:&lt;/strong&gt; Code-level checks within the application.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API Gateway Layer:&lt;/strong&gt; Dedicated gateways like Kong, Apigee, or AWS API Gateway.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network Layer:&lt;/strong&gt; Firewalls and load balancers limiting by IP addresses.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Common Rate Limiting Algorithms
&lt;/h2&gt;

&lt;p&gt;Understanding different rate limiting algorithms helps developers choose the best strategy for their application. Here are a few common ones:&lt;/p&gt;
&lt;h3&gt;
  
  
  Token Bucket
&lt;/h3&gt;

&lt;p&gt;The token bucket algorithm allows for a certain number of tokens to be added to a bucket at a fixed rate. Each request "spends" a token. If tokens are available, the request is allowed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Simple Python simulation of Token Bucket
class TokenBucket:
    def __init__ (self, capacity, refill_rate):
        self.capacity = capacity
        self.tokens = capacity
        self.refill_rate = refill_rate

    def allow_request(self):
        if self.tokens &amp;gt; 0:
            self.tokens -= 1
            return True
        return False

    def refill(self):
        self.tokens = min(self.capacity, self.tokens + self.refill_rate)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above code, &lt;code&gt;allow_request&lt;/code&gt; checks if tokens are available, and &lt;code&gt;refill&lt;/code&gt; simulates token regeneration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Leaky Bucket
&lt;/h3&gt;

&lt;p&gt;The leaky bucket algorithm treats incoming requests like water poured into a bucket with a small hole at the bottom. Water (requests) leaks at a constant rate, regardless of the inflow rate. If too much water is poured at once and the bucket overflows, incoming requests are discarded. This method ensures a consistent, controlled output rate, smoothing traffic bursts and preventing system overload.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fixed Window
&lt;/h3&gt;

&lt;p&gt;Fixed window rate limiting divides time into equal segments (like 1-minute windows). It counts the number of requests in the current window and blocks requests that exceed the limit. For instance, a limit of 1000 requests per minute resets at the beginning of every minute. Although simple to implement, it may allow traffic spikes at window boundaries, causing short-term bursts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sliding Window Log
&lt;/h3&gt;

&lt;p&gt;Sliding window log is a more accurate but resource-intensive method. It keeps a timestamped log of every request and continuously checks how many requests occurred within a moving time frame (e.g., the last 60 seconds). When a new request arrives, the system purges old timestamps and decides based on the updated log. This provides smoother traffic management and avoids sudden spikes seen in fixed windows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Practical Examples of Rate Limiting
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Example 1: API Usage
&lt;/h3&gt;

&lt;p&gt;A public API like GitHub's API uses rate limiting to prevent abuse. For instance, unauthenticated users might be limited to 60 requests per hour, while authenticated users can have higher limits.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example 2: Login Systems
&lt;/h3&gt;

&lt;p&gt;Login endpoints implement rate limiting to prevent brute-force attacks. For instance, a system might allow 5 login attempts per IP address every 10 minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Best Practices for Implementing Rate Limiting
&lt;/h2&gt;

&lt;p&gt;Implementing rate limiting effectively requires thoughtful planning to balance user experience, system performance, and security. Below are some best practices to guide you.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Return Clear Error Messages:&lt;/strong&gt; Include “Retry-After” headers when blocking requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Different Limits for Different Users:&lt;/strong&gt; Offer higher limits for authenticated or premium users.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monitoring and Alerts:&lt;/strong&gt; Track rate limit events and trigger alerts if thresholds are consistently exceeded.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Graceful Degradation:&lt;/strong&gt; Allow limited access instead of outright blocking whenever possible.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Rate Limiting in Different Industries
&lt;/h2&gt;

&lt;p&gt;Rate limiting plays a critical role across many industries, ensuring that applications remain stable, secure, and efficient under varying loads. Different industries apply rate limiting strategies based on their unique operational needs.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;E-commerce:&lt;/strong&gt; In e-commerce, rate limiting protects checkout and payment APIs to prevent fraud and service degradation during major sales events like Black Friday.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Financial Services:&lt;/strong&gt; Banks and financial institutions use rate limiting to secure sensitive transaction endpoints, prevent fraud, and comply with regulatory requirements such as PSD2 or PCI-DSS.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Social Media Platforms:&lt;/strong&gt; Social media networks like Twitter and Instagram aggressively apply rate limiting to curb bots, reduce scraping activities, and maintain platform health.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Gaming Industry:&lt;/strong&gt; Online games use rate limiting to ensure fairness in gameplay and protect their servers from bot attacks and spam requests.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Healthcare Applications:&lt;/strong&gt; Healthcare systems implement rate limiting to control access to sensitive patient data, ensuring compliance with standards like HIPAA and minimizing risks of system overload.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Challenges of Rate Limiting
&lt;/h2&gt;

&lt;p&gt;While rate limiting is powerful, it can introduce challenges:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;False Positives:&lt;/strong&gt; Legitimate users might get blocked.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scaling Issues:&lt;/strong&gt; Managing rate limits across distributed systems can be complex.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User Frustration:&lt;/strong&gt; Overly aggressive limits can degrade the user experience.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Solutions include adaptive rate limits, user-specific thresholds, and clear communication through error messages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tools and Libraries for Rate Limiting
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Redis:&lt;/strong&gt; Often used for storing counters and implementing rate limits efficiently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NGINX:&lt;/strong&gt; Built-in modules for HTTP rate limiting.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Envoy Proxy:&lt;/strong&gt; Offers dynamic rate limiting via external services.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Libraries:&lt;/strong&gt; Libraries like &lt;code&gt;express-rate-limit&lt;/code&gt; for Node.js or &lt;code&gt;django-ratelimit&lt;/code&gt; for Django.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Proxies at ScrapFly
&lt;/h2&gt;

&lt;p&gt;ScrapFly &lt;a href="https://scrapfly.io/proxy-saver" rel="noopener noreferrer"&gt;Proxy Saver&lt;/a&gt; is a proxy middleware that optimizes your existing proxy connections—cutting bandwidth usage, reducing failure rates, and adding advanced smart caching and fingerprinting layers to any proxy source.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/proxy-saver/getting-started" rel="noopener noreferrer"&gt;Bandwidth reduction&lt;/a&gt; – stub unnecessary image, font, and CSS requests to save up to 30% in data costs.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/proxy-saver/getting-started#cache" rel="noopener noreferrer"&gt;Smart page caching&lt;/a&gt; – speed up repeated requests with automatic page, redirect, and CORS caching.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/proxy-saver/getting-started#fingerprint" rel="noopener noreferrer"&gt;Fingerprint restoration&lt;/a&gt; – impersonate real browsers or restore original proxy fingerprints to avoid detection.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/proxy-saver/getting-started#retry" rel="noopener noreferrer"&gt;Automatic retries and healing&lt;/a&gt; – built-in logic fixes bad headers, errors, and retryable failures.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/proxy-saver/getting-started#integration" rel="noopener noreferrer"&gt;Simple integration&lt;/a&gt; – plug into your proxy stack via a single dashboard with full parameter forwarding support.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/proxy-saver/getting-started#protocol" rel="noopener noreferrer"&gt;Full protocol support&lt;/a&gt; – works with HTTP, HTTPS, HTTP2, and SOCKS5 connections for maximum compatibility.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fcommon_scrapfly-api.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fcommon_scrapfly-api.svg" alt="What is Rate Limiting? Everything You Need to Know" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Proxy Saver: supercharge any proxy provider with middleware performance boosts.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scrapfly.io/proxy-saver" rel="noopener noreferrer"&gt;Try Proxy Saver For FREE!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scrapfly.io/docs/proxy-saver/getting-started" rel="noopener noreferrer"&gt;Read Proxy Saver Docs&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQs
&lt;/h2&gt;

&lt;p&gt;Below are quick answers to common questions about rate limiting.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is a 429 Error?
&lt;/h3&gt;

&lt;p&gt;A 429 Error means "Too Many Requests." It indicates that the user has sent too many requests in a given amount of time and has hit the rate limit.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Can I Bypass Rate Limits?
&lt;/h3&gt;

&lt;p&gt;Bypassing rate limits is generally unethical and discouraged. Instead, consider applying for higher usage quotas or optimizing your application's request patterns.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can Rate Limiting Be Dynamic?
&lt;/h3&gt;

&lt;p&gt;Yes, dynamic rate limiting adjusts thresholds based on server load, user tiers, or other runtime parameters to offer flexible control.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Rate limiting is an essential tool for any developer working with APIs, web services, or scalable applications. It ensures system stability, fairness, and security. By understanding the different algorithms, real-world applications, challenges, and best practices, you can implement effective rate-limiting strategies in your projects.&lt;/p&gt;

&lt;p&gt;Now that you have a clear understanding of what is rate limiting and how to implement it, you can build more reliable and secure systems.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Optimize Proxies</title>
      <dc:creator>Scrapfly</dc:creator>
      <pubDate>Thu, 24 Apr 2025 14:46:04 +0000</pubDate>
      <link>https://dev.to/scrapfly_dev/how-to-optimize-proxies-3b5p</link>
      <guid>https://dev.to/scrapfly_dev/how-to-optimize-proxies-3b5p</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkmpgf5ni8iug4s5qsx28.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkmpgf5ni8iug4s5qsx28.webp" alt="How to Optimize Proxies" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftjka64pwpdg5fz95uvsw.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftjka64pwpdg5fz95uvsw.webp" alt="How to Optimize Proxies" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Whether you're scraping websites, managing multiple accounts, or protecting your privacy, using proxies efficiently can be the difference between success and constant frustration. Knowing how to optimize proxies isn't just a technical necessity—it's a strategic advantage for developers.&lt;/p&gt;

&lt;p&gt;In this article, we'll explore the key techniques to optimize proxy use, compare proxies with VPNs for clarity, and show you how tools like Scrapfly Proxy Saver can save you time and resources.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Does It Mean to Optimize Proxies?
&lt;/h2&gt;

&lt;p&gt;Optimizing proxies means configuring and using them in a way that maximizes speed, maintains anonymity, and reduces costs. This involves selecting the right proxy types, managing sessions properly, and understanding your use case.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choosing the Right Type of Proxy
&lt;/h2&gt;

&lt;p&gt;There are different types of proxies, each with specific advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/blog/the-best-datacenter-proxies-in-2025-a-complete-guide/" rel="noopener noreferrer"&gt;&lt;strong&gt;Datacenter Proxies&lt;/strong&gt;&lt;/a&gt;: Fast and affordable but easier to detect.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/blog/top-5-residential-proxy-providers/" rel="noopener noreferrer"&gt;&lt;strong&gt;Residential Proxies&lt;/strong&gt;&lt;/a&gt;: Harder to block and better for anonymity but more expensive.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/blog/mobile-vs-residential-proxies-whats-the-difference/" rel="noopener noreferrer"&gt;&lt;strong&gt;Mobile Proxies&lt;/strong&gt;&lt;/a&gt;: Offer the highest anonymity but often come with limitations in speed and availability.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Selecting the right proxy depends on your specific needs—whether it's speed, cost-efficiency, or stealth.&lt;/p&gt;

&lt;h2&gt;
  
  
  Technical Setup for Maximum Speed
&lt;/h2&gt;

&lt;p&gt;Speed optimization starts with minimizing latency and ensuring stability. Here's a sample setup using a proxy in Python:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests

proxies = {
    'http': 'http://user:pass@proxyserver:port',
    'https': 'http://user:pass@proxyserver:port'
}

response = requests.get('https://httpbin.org/ip', proxies=proxies)
print(response.json())

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above code, we configure HTTP and HTTPS requests to route through a proxy. This method allows us to distribute requests and avoid rate limiting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Maintaining Anonymity
&lt;/h2&gt;

&lt;p&gt;To maintain anonymity while using proxies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rotate proxies frequently.&lt;/li&gt;
&lt;li&gt;Use user-agent strings that mimic real browsers.&lt;/li&gt;
&lt;li&gt;Avoid predictable patterns in request behavior.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These practices help prevent detection and blocking by websites.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keeping Costs Under Control
&lt;/h2&gt;

&lt;p&gt;Bandwidth costs and proxy rates can add up quickly. To reduce expenses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use datacenter proxies for high-volume, low-risk scraping.&lt;/li&gt;
&lt;li&gt;Reserve residential proxies for complex or sensitive targets.&lt;/li&gt;
&lt;li&gt;Implement intelligent request throttling to reduce unnecessary usage.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Proxy vs. VPN: A Quick Comparison
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Proxy&lt;/th&gt;
&lt;th&gt;VPN&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Speed&lt;/td&gt;
&lt;td&gt;Faster&lt;/td&gt;
&lt;td&gt;Slightly slower due to encryption&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Anonymity&lt;/td&gt;
&lt;td&gt;Depends on proxy type&lt;/td&gt;
&lt;td&gt;High, but centralized&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Use Case&lt;/td&gt;
&lt;td&gt;Scraping, automation, SEO tools&lt;/td&gt;
&lt;td&gt;General browsing, streaming&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;Variable (can be low)&lt;/td&gt;
&lt;td&gt;Often subscription-based&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For more detail, check out our article:&lt;/p&gt;

&lt;p&gt;[&lt;/p&gt;

&lt;p&gt;Proxy vs VPN: In-Depth Comparison&lt;/p&gt;

&lt;p&gt;Explore the proxy vs vpn debate with insights on key differences, benefits, limitations and alternatives. Discover when to choose a proxy or VPN.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fproxy-vs-vpn_banner_light.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fproxy-vs-vpn_banner_light.svg" alt="How to Optimize Proxies" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
](&lt;a href="https://scrapfly.io/blog/proxy-vs-vpn/" rel="noopener noreferrer"&gt;https://scrapfly.io/blog/proxy-vs-vpn/&lt;/a&gt;)&lt;/p&gt;
&lt;h2&gt;
  
  
  Proxy in Web Scraping
&lt;/h2&gt;

&lt;p&gt;Proxies play a pivotal role in web scraping, acting as intermediaries that mask your IP address, rotate identities, and help access region-restricted or rate-limited data sources. Whether you're working on small scripts or enterprise-scale data pipelines, proxies ensure that your scraping operations remain anonymous and uninterrupted.&lt;/p&gt;
&lt;h3&gt;
  
  
  Why Proxies Matter in Web Scraping
&lt;/h3&gt;

&lt;p&gt;Using a proxy allows you to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Avoid IP bans by rotating through multiple addresses.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Access geo-specific content by routing requests through different countries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stay under the radar with residential or mobile IPs that mimic real user behavior.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Integrating proxies effectively helps ensure scalability, reliability, and compliance in web scraping tasks.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let’s look at how to improve proxy usage by reducing resource load.&lt;/p&gt;
&lt;h2&gt;
  
  
  Blocking Resource Loading in Web Scraping Tools
&lt;/h2&gt;

&lt;p&gt;Blocking unnecessary resources like images and media files can significantly speed up your web scraping process and save proxy bandwidth. Here's how you can do it in different libraries:&lt;/p&gt;
&lt;h3&gt;
  
  
  Selenium
&lt;/h3&gt;

&lt;p&gt;First, install Selenium:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install selenium

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use Chrome options to disable images or combine Selenium with &lt;code&gt;mitmproxy&lt;/code&gt; for advanced filtering:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.headless = True
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--blink-settings=imagesEnabled=false')
chrome_options.add_experimental_option(
    "prefs", {"profile.managed_default_content_settings.images": 2}
)
driver = webdriver.Chrome(options=options, chrome_options=chrome_options)
driver.get("https://www.example.com")
driver.quit()

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or block specific resource types using &lt;code&gt;mitmproxy&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;First, install mitmproxy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install mitmproxy


# Save as block.py and run with mitmproxy -s block.py
from mitmproxy import http
BLOCK_RESOURCE_EXTENSIONS = ['.gif', '.jpg', '.jpeg', '.png', '.webp']
def request(flow: http.HTTPFlow) -&amp;gt; None:
    if any(flow.request.pretty_url.endswith(ext) for ext in BLOCK_RESOURCE_EXTENSIONS):
        flow.response = http.Response.make(404, b"Blocked", {"Content-Type": "text/html"})

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For more, read the full guide:&lt;/p&gt;

&lt;p&gt;[&lt;/p&gt;

&lt;p&gt;Web Scraping with Selenium and Python Tutorial + Example Project&lt;/p&gt;

&lt;p&gt;Selenium and Python tutorial for web scraping dynamic, javascript powered websites using a headless Chrome webdriver. Real life example project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fweb-scraping-with-selenium-and-python_banner_light.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fweb-scraping-with-selenium-and-python_banner_light.svg" alt="How to Optimize Proxies" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
](&lt;a href="https://scrapfly.io/blog/web-scraping-with-selenium-and-python/" rel="noopener noreferrer"&gt;https://scrapfly.io/blog/web-scraping-with-selenium-and-python/&lt;/a&gt;)&lt;/p&gt;
&lt;h3&gt;
  
  
  Playwright
&lt;/h3&gt;

&lt;p&gt;First, install Playwright:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install playwright
playwright install

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Intercept requests and block unwanted resources by type or keyword:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from playwright.sync_api import sync_playwright

def intercept_route(route):
    if route.request.resource_type in ['image', 'media']:
        return route.abort()
    return route.continue_()

with sync_playwright() as pw:
    browser = pw.chromium.launch(headless=True)
    page = browser.new_page()
    page.route("**/*", intercept_route)
    page.goto("https://www.example.com")
    browser.close()

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For more, read the full guide:&lt;/p&gt;

&lt;p&gt;[&lt;/p&gt;

&lt;p&gt;Web Scraping with Playwright and Python&lt;/p&gt;

&lt;p&gt;Playwright is the new, big browser automation toolkit - can it be used for web scraping? In this introduction article, we'll take a look how can we use Playwright and Python to scrape dynamic websites.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fweb-scraping-with-playwright-and-python_banner_light.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fweb-scraping-with-playwright-and-python_banner_light.svg" alt="How to Optimize Proxies" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
](&lt;a href="https://scrapfly.io/blog/web-scraping-with-playwright-and-python/" rel="noopener noreferrer"&gt;https://scrapfly.io/blog/web-scraping-with-playwright-and-python/&lt;/a&gt;)&lt;/p&gt;
&lt;h3&gt;
  
  
  Puppeteer
&lt;/h3&gt;

&lt;p&gt;First, install Puppeteer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install puppeteer

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Puppeteer enables blocking based on resource type or matching URLs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const puppeteer = require('puppeteer');
(async () =&amp;gt; {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.setRequestInterception(true);

  page.on('request', request =&amp;gt; {
    if (['image', 'media'].includes(request.resourceType())) {
      request.abort();
    } else {
      request.continue();
    }
  });

  await page.goto('https://www.example.com');
  await browser.close();
})();

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For more, read the full guide:&lt;/p&gt;

&lt;p&gt;[&lt;/p&gt;

&lt;p&gt;How to Web Scrape with Puppeteer and NodeJS in 2025&lt;/p&gt;

&lt;p&gt;Puppeteer and nodejs tutorial (javascript) for web scraping dynamic web pages and web apps. Tips and tricks, best practices and example project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fweb-scraping-with-puppeteer-and-nodejs_banner_light.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fweb-scraping-with-puppeteer-and-nodejs_banner_light.svg" alt="How to Optimize Proxies" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
](&lt;a href="https://scrapfly.io/blog/web-scraping-with-playwright-and-python/" rel="noopener noreferrer"&gt;https://scrapfly.io/blog/web-scraping-with-playwright-and-python/&lt;/a&gt;)&lt;/p&gt;

&lt;h2&gt;
  
  
  Scrapfly Proxy Saver
&lt;/h2&gt;

&lt;p&gt;Scrapfly Proxy Saver is a middleware solution designed to enhance your existing proxy setup by optimizing bandwidth usage, improving stability, and providing advanced fingerprinting capabilities. It acts as a man-in-the-middle (MITM) service, offering a suite of features tailored for developers and data professionals.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Benefits
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bandwidth Optimization&lt;/strong&gt; : By stubbing unnecessary resources like images and CSS, Proxy Saver can reduce bandwidth consumption by up to 30%.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automatic Caching&lt;/strong&gt; : Leverage Scrapfly's CDN to automatically cache results, redirects, and CORS, enhancing response times and reducing redundant requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fingerprint Impersonation&lt;/strong&gt; : Choose from a pool of real web browser profiles to mimic genuine user behavior, aiding in bypassing proxy detection mechanisms.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enhanced Stability&lt;/strong&gt; : Proxy Saver improves connection stability by automatically retrying failed requests and resolving common proxy issues.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Seamless Integration&lt;/strong&gt; : Supports integration with platforms like Python and TypeScript, ensuring flexibility across different development environments.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Use Cases
&lt;/h3&gt;

&lt;p&gt;Proxy Saver is versatile and caters to various industries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AI Training&lt;/strong&gt; : Reduce bandwidth usage and increase response times when working with data-intensive websites.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compliance&lt;/strong&gt; : Efficiently proxy to compliance sources, ensuring data integrity and reduced overhead.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;eCommerce&lt;/strong&gt; : Enhance stability when accessing e-commerce platforms, ensuring consistent data retrieval.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Financial Services&lt;/strong&gt; : Optimize bandwidth and response times when interfacing with financial data sources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fraud Detection&lt;/strong&gt; : Improve response times and reduce bandwidth usage in fraud detection systems.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Getting Started
&lt;/h3&gt;

&lt;p&gt;To utilize Proxy Saver:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Create a Proxy Saver Instance&lt;/strong&gt; : Access the Scrapfly dashboard and set up a new Proxy Saver instance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configure Your Proxy&lt;/strong&gt; : Attach your existing proxy connection to the Proxy Saver instance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authentication&lt;/strong&gt; : Use the standard &lt;code&gt;username:password&lt;/code&gt; scheme, where the username is &lt;code&gt;proxyId-XXX&lt;/code&gt; (your proxy ID) and the password is your API key.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Advanced Configuration&lt;/strong&gt; : Utilize parameters like &lt;code&gt;Timeout-10&lt;/code&gt; to set timeouts or &lt;code&gt;FpImpersonate-chrome_win_130&lt;/code&gt; to impersonate specific browser fingerprints.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Pricing
&lt;/h3&gt;

&lt;p&gt;Proxy Saver operates on a pay-as-you-go model:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Base Rate&lt;/strong&gt; : $0.2 per GB of bandwidth used.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Additional Features&lt;/strong&gt; : Fingerprint impersonation incurs an extra $0.1 per GB.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Monitor your usage and billing details directly from the Proxy Saver dashboard.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scrapfly.io/proxy-saver" rel="noopener noreferrer"&gt;Try Proxy Saver&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scrapfly.io/docs" rel="noopener noreferrer"&gt;More on Scrapfly&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Caching Proxy Strategies
&lt;/h2&gt;

&lt;p&gt;Caching is a powerful technique to boost the efficiency of proxy usage. By avoiding redundant data requests, developers can significantly reduce costs and improve speed, especially in large-scale scraping projects.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Use Caching with Proxies?
&lt;/h3&gt;

&lt;p&gt;Caching in proxy workflows ensures that data retrieval is not only faster but also more economical. By storing commonly accessed responses, you can greatly minimize redundant traffic and API load.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Reduce Bandwidth Costs&lt;/strong&gt; : Avoid fetching the same data multiple times, which is especially useful with paid proxies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improve Speed&lt;/strong&gt; : Cached data loads faster, reducing wait times.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enhance Stability&lt;/strong&gt; : Reduces the volume of live requests sent through proxies, minimizing potential failures.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How to Implement Caching
&lt;/h3&gt;

&lt;p&gt;There are multiple layers at which caching can be implemented, each offering unique advantages. Whether you're working locally or integrating with a proxy service, there are effective solutions to fit your needs.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Local Caching&lt;/strong&gt; : Use tools like &lt;code&gt;requests-cache&lt;/code&gt; in Python.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Proxy-Level Caching&lt;/strong&gt; : Leverage built-in features in services like Scrapfly Proxy Saver that offer CDN caching.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom Strategies&lt;/strong&gt; : Develop logic that checks for cached responses before querying external sites.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests
import requests_cache

requests_cache.install_cache('demo_cache', backend='sqlite', expire_after=180)
response = requests.get('https://example.com/data')
print(response.from_cache) # Indicates if response was cached

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that you understand how caching can boost proxy efficiency, let’s move on to common questions developers have.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQs
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Can proxies handle JavaScript-heavy sites?
&lt;/h3&gt;

&lt;p&gt;Yes, proxies can be used with JavaScript-heavy websites, but you'll need to use headless browsers or frameworks like Puppeteer and Playwright that support JavaScript rendering. Proxies ensure traffic routing while these tools manage dynamic content loading.&lt;/p&gt;

&lt;h3&gt;
  
  
  Are there free proxies worth using?
&lt;/h3&gt;

&lt;p&gt;Free proxies exist and may work for basic or low-risk tasks, but they often suffer from issues like slow speeds, instability, or a high chance of being blocked. For reliable performance, it's recommended to use paid or vetted proxy services.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do I test if a proxy is working?
&lt;/h3&gt;

&lt;p&gt;You can test proxies by sending a request to a service like &lt;code&gt;httpbin.org/ip&lt;/code&gt; or using proxy checker tools. If the IP in the response matches your proxy and no errors occur, the proxy is functioning correctly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;To optimize proxies effectively, you need to select the appropriate proxy type, fine-tune your technical implementation for speed, and practice cost-efficient usage. By understanding the differences between proxies and VPNs, and using tools like Scrapfly Proxy Saver, developers can significantly improve their workflow and performance.&lt;/p&gt;

</description>
      <category>proxies</category>
    </item>
    <item>
      <title>How to Build an MCP Server in Python: A Complete Guide</title>
      <dc:creator>Scrapfly</dc:creator>
      <pubDate>Fri, 18 Apr 2025 10:26:55 +0000</pubDate>
      <link>https://dev.to/scrapfly_dev/how-to-build-an-mcp-server-in-python-a-complete-guide-28bp</link>
      <guid>https://dev.to/scrapfly_dev/how-to-build-an-mcp-server-in-python-a-complete-guide-28bp</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqy4gkqq2bb02gy45tgo3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqy4gkqq2bb02gy45tgo3.png" alt="How to Build an MCP Server in Python: A Complete Guide" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb99egg5a9gjlopklx6u8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb99egg5a9gjlopklx6u8.png" alt="How to Build an MCP Server in Python: A Complete Guide" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Building an &lt;a href="https://scrapfly.io/blog/what-is-mcp-understanding-the-model-context-protocol/" rel="noopener noreferrer"&gt;MCP (Model Context Protocol)&lt;/a&gt; server allows your applications to interact directly with large language models by exposing custom tools, resources, and prompts. Whether you're building a plugin-like system for LLMs or enabling external AI integrations, the MCP server serves as a crucial bridge.&lt;/p&gt;

&lt;p&gt;In this guide, we'll walk through how to build a simple MCP server in Python using a calculator example.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the Model Context Protocol (MCP)?
&lt;/h2&gt;

&lt;p&gt;The model context protocol (MCP) is an open standard developed to let external tools, APIs, or plugins communicate with large language models (LLMs). An MCP server is a program you run locally or remotely that LLMs (like Claude or those in Cursor) can connect to and call defined functions, query resources, or use prompt templates.&lt;/p&gt;

&lt;p&gt;In MCP, there are three key components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tools: Functions that can be called by the model.&lt;/li&gt;
&lt;li&gt;Resources: Static or dynamic files or data the model can request.&lt;/li&gt;
&lt;li&gt;Prompts: Templated messages that guide the model's output.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For more details about MCP checkout our article:&lt;/p&gt;

&lt;p&gt;[&lt;/p&gt;

&lt;p&gt;What Is MCP? Understanding the Model Context Protocol&lt;/p&gt;

&lt;p&gt;What is MCP? Learn how the Model Context Protocol powers tools like Copilot Studio by giving AI models access to real-time, structured context.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuussipf5yo4y6h4we32o.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuussipf5yo4y6h4we32o.webp" alt="How to Build an MCP Server in Python: A Complete Guide" width="800" height="533"&gt;&lt;/a&gt;&lt;br&gt;
](&lt;a href="https://scrapfly.io/blog/what-is-mcp-understanding-the-model-context-protocol/" rel="noopener noreferrer"&gt;https://scrapfly.io/blog/what-is-mcp-understanding-the-model-context-protocol/&lt;/a&gt;)&lt;/p&gt;
&lt;h2&gt;
  
  
  Understanding the Basics of MCP Communication
&lt;/h2&gt;

&lt;p&gt;Before diving into code, it’s essential to understand how models interact with your server. MCP servers operate over transports like &lt;code&gt;stdio&lt;/code&gt;, &lt;code&gt;http&lt;/code&gt;, or &lt;code&gt;websocket&lt;/code&gt;. A host like Cursor will send JSON-based requests, and your server responds with tool results, prompt content, or resource data.&lt;/p&gt;

&lt;p&gt;This design allows the model to dynamically call your tools or read your files just like a plugin system.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why Use MCP Instead of Other APIs?
&lt;/h2&gt;

&lt;p&gt;MCP is purpose-built for LLMs. Unlike REST APIs that require explicit engineering effort to query, MCP integrates directly with model interfaces. Your functions become accessible as if the model "knew" how to call them.&lt;/p&gt;

&lt;p&gt;This makes it ideal for prototyping, teaching, internal tools, and research-driven interfaces.&lt;/p&gt;
&lt;h2&gt;
  
  
  Setting Up Your Python Environment
&lt;/h2&gt;

&lt;p&gt;First, ensure you have Python 3.10 or later installed. Then, create a virtual environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python -m venv mcp-env
source mcp-env/bin/activate # On Windows: mcp-env\Scripts\activate

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates an isolated environment for your project, helping avoid conflicts with other Python packages.&lt;/p&gt;

&lt;p&gt;Install the MCP SDK:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install mcp "mcp[cli]"

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;mcp&lt;/code&gt; package provides the server framework and CLI utilities. The &lt;code&gt;[cli]&lt;/code&gt; extra installs additional command-line tools.&lt;/p&gt;

&lt;p&gt;To verify installation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mcp version

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the installed version number, confirming a successful setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating Your First MCP Server (Calculator Example)
&lt;/h2&gt;

&lt;p&gt;Let’s start with a basic calculator tool that adds two numbers. Create a file named &lt;code&gt;calculator.py&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from mcp.server.fastmcp import FastMCP # Import FastMCP, the quickstart server base

mcp = FastMCP("Calculator Server") # Initialize an MCP server instance with a descriptive name

@mcp.tool() # Register a function as a callable tool for the model
def add(a: int, b: int) -&amp;gt; int:
    """Add two numbers and return the result."""
    return a + b # Simple arithmetic logic

if __name__ == " __main__":
    mcp.run(transport="stdio") # Run the server, using standard input/output for communication

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This script defines a minimal MCP server with one tool, &lt;code&gt;add&lt;/code&gt;. The &lt;code&gt;@mcp.tool()&lt;/code&gt; decorator tells the MCP framework that this function should be available to connected LLMs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Context and Advanced Tools
&lt;/h2&gt;

&lt;p&gt;MCP tools can go beyond simple math—they can access the internet, return rich media like images, and be written asynchronously. Here are a few examples to extend your calculator-themed server with more functionality.&lt;/p&gt;

&lt;h3&gt;
  
  
  Body Mass Index (BMI) Calculator Tool
&lt;/h3&gt;

&lt;p&gt;This tool calculates BMI, which is a useful health-related metric:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@mcp.tool()
def calculate_bmi(weight_kg: float, height_m: float) -&amp;gt; float:
    """Calculate BMI given weight in kg and height in meters"""
    return round(weight_kg / (height_m ** 2), 2)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This fits well into a calculator suite for health and fitness features.&lt;/p&gt;

&lt;h3&gt;
  
  
  Live Exchange Rate Fetcher (Async)
&lt;/h3&gt;

&lt;p&gt;Here’s how to add a tool that fetches live currency exchange rates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import httpx

@mcp.tool()
async def get_exchange_rate(from_currency: str, to_currency: str) -&amp;gt; str:
    """Fetch current exchange rate from one currency to another."""
    async with httpx.AsyncClient() as client:
        response = await client.get(
            f"https://api.exchangerate-api.com/v4/latest/{from_currency}"
        )
        rates = response.json().get("rates", {})
        rate = rates.get(to_currency)
        if rate:
            return f"1 {from_currency} = {rate} {to_currency}"
        return "Unable to fetch exchange rate."

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This can make your calculator server useful for travelers and finance apps.&lt;/p&gt;

&lt;h3&gt;
  
  
  Previewing Image-Based Calculations
&lt;/h3&gt;

&lt;p&gt;You can also process images using the built-in &lt;code&gt;Image&lt;/code&gt; class. For instance, previewing a graph or bill snapshot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from mcp.server.fastmcp import Image
from PIL import Image as PILImage

@mcp.tool()
def generate_thumbnail(image_path: str) -&amp;gt; Image:
    """Generate a thumbnail for a provided image (e.g., bill or graph)."""
    img = PILImage.open(image_path)
    img.thumbnail((120, 120))
    return Image(data=img.tobytes(), format="png")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This could be used when the LLM is reviewing visual data like receipts or chart screenshots.&lt;/p&gt;

&lt;h3&gt;
  
  
  Using Context to Track Progress
&lt;/h3&gt;

&lt;p&gt;Some tasks, like parsing multiple calculation files, may take time. MCP provides a &lt;code&gt;Context&lt;/code&gt; object to manage progress and logging:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from mcp.server.fastmcp import Context

@mcp.tool()
async def batch_process(files: list[str], ctx: Context) -&amp;gt; str:
    """Simulate batch calculation from uploaded files with progress feedback."""
    for i, file in enumerate(files):
        ctx.info(f"Processing file {file}")
        await ctx.report_progress(i + 1, len(files))
        data, mime_type = await ctx.read_resource(f"file://{file}")
    return "Batch processing complete"

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gives both you and the model transparency into what's happening behind the scenes—ideal for long-running tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding More Tools
&lt;/h2&gt;

&lt;p&gt;Expand your calculator with subtraction, multiplication, and division:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@mcp.tool()
def subtract(a: int, b: int) -&amp;gt; int:
    """Subtract the second number from the first."""
    return a - b

@mcp.tool()
def multiply(a: int, b: int) -&amp;gt; int:
    """Multiply two numbers."""
    return a * b

@mcp.tool()
def divide(a: float, b: float) -&amp;gt; float:
    """Divide the first number by the second. Raises error on division by zero."""
    if b == 0:
        raise ValueError("Division by zero")
    return a / b

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each tool is explicitly documented. If an LLM queries available tools, it will see these docstrings, helping it understand the correct usage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Organizing Your MCP Project
&lt;/h2&gt;

&lt;p&gt;For beginners, it helps to structure your code into folders:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mcp-calculator/
├── calculator.py
├── tools/
│ └── arithmetic.py
├── prompts/
│ └── templates.txt
└── docs/
    └── usage.txt

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then import and register each tool separately. This improves maintainability and scaling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Exposing Resources
&lt;/h2&gt;

&lt;p&gt;In MCP, resources can be either static files or dynamic responses. Here's how to define a dynamic resource using the &lt;code&gt;@mcp.resource()&lt;/code&gt; decorator:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Add a dynamic greeting resource
@mcp.resource("calculator://greet/{name}")
def calculator_greeting(name: str) -&amp;gt; str:
    """Get a personalized greeting"""
    return f"Hello, {name}! Ready to calculate something today?"

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes the URL &lt;code&gt;greeting://yourname&lt;/code&gt; available to the model. When the model queries this resource, the function will execute and return the corresponding greeting.&lt;/p&gt;

&lt;p&gt;You can also use static resources like text files for documentation or data.&lt;/p&gt;

&lt;p&gt;Create a &lt;code&gt;docs&lt;/code&gt; folder and add a file named &lt;code&gt;usage.txt&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;This MCP server can perform basic arithmetic functions. Use tools like add, subtract, multiply, and divide.

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@mcp.resource("usage://guide")
def get_usage() -&amp;gt; str:
    with open("docs/usage.txt") as f:
        return f.read()

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This returns the content of the file when requested by the model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating Prompts
&lt;/h2&gt;

&lt;p&gt;In MCP, prompts can also be defined using functions decorated with &lt;code&gt;@mcp.prompt()&lt;/code&gt;. This allows for dynamic, conditional, and reusable prompt generation.&lt;/p&gt;

&lt;p&gt;Here’s an example that combines all four operations into a single prompt function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@mcp.prompt()
def calculator_prompt(a: float, b: float, operation: str) -&amp;gt; str:
    """Prompt for a calculation and return the result."""
    if operation == "add":
        return f"The result of adding {a} and {b} is {add(a, b)}"
    elif operation == "subtract":
        return f"The result of subtracting {b} from {a} is {subtract(a, b)}"
    elif operation == "multiply":
        return f"The result of multiplying {a} and {b} is {multiply(a, b)}"
    elif operation == "divide":
        try:
            return f"The result of dividing {a} by {b} is {divide(a, b)}"
        except ValueError as e:
            return str(e)
    else:
        return "Invalid operation. Please choose add, subtract, multiply, or divide."

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This function returns a human-readable summary for any supported operation. The model can invoke it with arguments, and receive consistent, contextual output.&lt;/p&gt;

&lt;h2&gt;
  
  
  Running the Server
&lt;/h2&gt;

&lt;p&gt;To run the server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mcp run path/to/calculator.py

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can connect it with a tool like Cursor or Claude Desktop. In Cursor:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to Cursor &lt;code&gt;Settings&lt;/code&gt; &amp;gt; &lt;code&gt;MCP&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Add new global MCP server&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Cursor stores MCP server definitions in a JSON format. You can add your server manually to the configuration like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "mcpServers": {
      "local-mcp": {
        "command": "python",
        "args": [
          "path/to/your/local/mcp/calculator.py"
        ]
      }
    }
 }

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once connected, Cursor will automatically detect your tools and show them under your server listing.&lt;/p&gt;

&lt;p&gt;You should see something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ob245qbx669lskdltay.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ob245qbx669lskdltay.png" alt="How to Build an MCP Server in Python: A Complete Guide" width="800" height="132"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then test it with natural language prompts like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;Add 7 and 5&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;What's 12 divided by 4?&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where and How to Test Your MCP Server
&lt;/h2&gt;

&lt;p&gt;The easiest way to test your MCP server is by running it with the MCP CLI tool, which includes a local dashboard for interacting with your prompts and tools.&lt;/p&gt;

&lt;h3&gt;
  
  
  Run the Dev Dashboard
&lt;/h3&gt;

&lt;p&gt;Use the following command in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mcp dev ./calculator.py

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command launches a local dev dashboard. Once the server is running, it will open a browser window where you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;View all registered tools and prompts&lt;/li&gt;
&lt;li&gt;Test each prompt by filling in parameters&lt;/li&gt;
&lt;li&gt;See the results and any errors in real time&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Which will result of this screen:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg2gjrk4fne29307ewtux.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg2gjrk4fne29307ewtux.png" alt="How to Build an MCP Server in Python: A Complete Guide" width="800" height="395"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This makes &lt;code&gt;mcp dev&lt;/code&gt; the most straightforward way to test and iterate on your MCP server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-World Use Cases for MCP Servers
&lt;/h2&gt;

&lt;p&gt;MCP servers are useful beyond experiments—they help connect your code to language models in practical, meaningful ways.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Internal tools: Let models assist with tasks like running calculations, generating reports, or querying databases.&lt;/li&gt;
&lt;li&gt;Customer support bots: Provide models access to live data, documentation, or helpdesk tools.&lt;/li&gt;
&lt;li&gt;Education: Build interactive learning aids for math, science, or coding using model-driven prompts and tools.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These examples show how MCP can add model interaction to everyday workflows, making your applications smarter and more interactive.&lt;/p&gt;

&lt;h2&gt;
  
  
  Power-up with Scrapfly
&lt;/h2&gt;

&lt;p&gt;ScrapFly provides &lt;a href="https://scrapfly.io/docs/scrape-api/getting-started" rel="noopener noreferrer"&gt;web scraping&lt;/a&gt;, &lt;a href="https://scrapfly.io/docs/screenshot-api/getting-started" rel="noopener noreferrer"&gt;screenshot&lt;/a&gt;, &lt;a href="https://scrapfly.io/docs/extraction-api/getting-started" rel="noopener noreferrer"&gt;extraction&lt;/a&gt;, and &lt;a href="https://scrapfly.io/proxy-saver" rel="noopener noreferrer"&gt;proxy saver&lt;/a&gt; APIs for data collection at scale. Each product is equipped with an automatic bypass for any anti-bot system, and we achieve this by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Maintaining a fleet of real, reinforced web browsers with real fingerprint profiles.&lt;/li&gt;
&lt;li&gt;Millions of self-healing proxies of the highest possible trust score.&lt;/li&gt;
&lt;li&gt;Constantly evolving and adapting to new anti-bot systems.&lt;/li&gt;
&lt;li&gt;Introducing &lt;a href="https://scrapfly.io/proxy-saver" rel="noopener noreferrer"&gt;Proxy Saver&lt;/a&gt; – a performance-boosting middleware that reduces bandwidth, improves stability, and adds fingerprint support to your own proxies.&lt;/li&gt;
&lt;li&gt;We've been doing this publicly since 2020 with the best bypass on the market!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fcommon_scrapfly-api.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fcommon_scrapfly-api.svg" alt="How to Build an MCP Server in Python: A Complete Guide" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scrapfly.io/register" rel="noopener noreferrer"&gt;Try for FREE!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scrapfly.io/docs" rel="noopener noreferrer"&gt;More on Scrapfly&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;Have questions about building or using an MCP server? Here are quick answers to some of the most common ones:&lt;/p&gt;

&lt;h3&gt;
  
  
  How do I create a dynamic resource?
&lt;/h3&gt;

&lt;p&gt;Use the &lt;code&gt;@mcp.resource()&lt;/code&gt; decorator with a dynamic path. For example, &lt;code&gt;calculator://greet/{name}&lt;/code&gt; allows models to access personalized data. The function will be called with the provided parameter.&lt;/p&gt;

&lt;h3&gt;
  
  
  What types can MCP tools return?
&lt;/h3&gt;

&lt;p&gt;MCP tools can return basic data types like strings, numbers, lists, and even binary media using the &lt;code&gt;Image&lt;/code&gt; class. The return type should match the expected use by the model or interface calling it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I use async functions in my tools?
&lt;/h3&gt;

&lt;p&gt;Yes, MCP fully supports &lt;code&gt;async def&lt;/code&gt; functions. These are useful for non-blocking operations like fetching data from APIs or processing large files without stalling your server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;This guide covered how to build an MCP server in Python using a calculator app as a clear, hands-on example. We explored the core components of the Model Context Protocol: tools, resources, and prompts, and how each one allows large language models to interact dynamically with your code. You learned how to implement basic and advanced tools including asynchronous functions, handle user input with custom prompts, and expose data through both static and dynamic resources.&lt;/p&gt;

&lt;p&gt;We also showed how to test your server locally using mcp dev, connect it to an LLM interface like Cursor, and structure your project for real-world development. Whether you're building internal utilities, educational tools, or LLM-driven interfaces, MCP provides a lightweight yet powerful standard to bridge AI and software.&lt;/p&gt;

</description>
      <category>ai</category>
    </item>
    <item>
      <title>What Is MCP? Understanding the Model Context Protocol</title>
      <dc:creator>Scrapfly</dc:creator>
      <pubDate>Mon, 14 Apr 2025 16:26:38 +0000</pubDate>
      <link>https://dev.to/scrapfly_dev/what-is-mcp-understanding-the-model-context-protocol-c9l</link>
      <guid>https://dev.to/scrapfly_dev/what-is-mcp-understanding-the-model-context-protocol-c9l</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuussipf5yo4y6h4we32o.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuussipf5yo4y6h4we32o.webp" alt="What Is MCP? Understanding the Model Context Protocol" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp2u8bkiobn4042ksspk9.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp2u8bkiobn4042ksspk9.webp" alt="What Is MCP? Understanding the Model Context Protocol" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The world of AI development is evolving fast, and with that evolution comes the need for more structured, scalable communication between models and their tools or environments. Enter the Model Context Protocol (MCP) a modern, standardized way for large language models (LLMs) like GPT-4 to interact with external data, tools, and APIs within a secure and modular ecosystem. If you’ve heard about Copilot Studio or MCP servers, you’re already closer to understanding how this framework works in action.&lt;/p&gt;

&lt;p&gt;If you're building your own AI assistant or developing context-aware applications, MCP ensures your models access the right information at the right time with built-in support for security, modularity, and scalability.&lt;/p&gt;

&lt;p&gt;&amp;lt;!--kg-card-end: markdown--&amp;gt;&amp;lt;!--kg-card-begin: markdown--&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is MCP?
&lt;/h2&gt;

&lt;p&gt;The Model Context Protocol (MCP) is a communication framework that allows large language models (LLMs) to dynamically interact with real-time, structured data. Instead of relying solely on static prompts or pre-trained information, MCP equips models with access to live tools, APIs, and services that are contextually relevant to a user’s query.&lt;/p&gt;

&lt;p&gt;MCP separates the AI model from backend logic and data, making systems more modular and easier to scale. This allows developers to reuse tools across different models and platforms while simplifying the integration of real-time data into AI-driven workflows.&lt;/p&gt;

&lt;p&gt;&amp;lt;!--kg-card-end: markdown--&amp;gt;&amp;lt;!--kg-card-begin: markdown--&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How Does MCP Work?
&lt;/h2&gt;

&lt;p&gt;MCP operates by managing the lifecycle of tool registration, context gathering, and inference orchestration. Here's a breakdown of how it functions:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxqigdcp2gzw1r8wxfigb.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxqigdcp2gzw1r8wxfigb.webp" alt="What Is MCP? Understanding the Model Context Protocol" width="800" height="529"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Tool Registration&lt;/strong&gt; : APIs and services register themselves with an MCP server, declaring what they can do and what inputs they need.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context Compilation&lt;/strong&gt; : When a query is submitted, the MCP system gathers all the necessary context from these registered tools—this might include user profiles, historical actions, or data from third-party systems.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model Invocation&lt;/strong&gt; : The compiled context is passed into the model as part of the inference request, allowing the model to generate a response that’s highly contextual and personalized.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This architecture ensures that models remain lightweight and focused on reasoning, while the MCP infrastructure handles the complexities of data access, validation, and selection.&lt;/p&gt;

&lt;p&gt;&amp;lt;!--kg-card-end: markdown--&amp;gt;&amp;lt;!--kg-card-begin: markdown--&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How Were AI Systems Handling Context Before MCP?
&lt;/h2&gt;

&lt;p&gt;Before the advent of MCP, AI developers had to rely on homegrown solutions for tool orchestration and context injection. These were often brittle and difficult to scale, typically involving hardcoded prompts or ad hoc plugin-style architectures.&lt;/p&gt;

&lt;p&gt;For instance:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Tools were added to LLMs using manual function calling, often lacking dynamic discovery or selection.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Context (like user profile or recent history) was flattened into prompts, leading to bloated, inefficient token usage.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Security and permissions had to be custom coded, exposing vulnerabilities.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This approach created significant friction, especially for enterprises building conversational interfaces or automated workflows across multiple services.&lt;/p&gt;

&lt;p&gt;&amp;lt;!--kg-card-end: markdown--&amp;gt;&amp;lt;!--kg-card-begin: markdown--&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How To Get Started with MCP
&lt;/h2&gt;

&lt;p&gt;The easiest way to begin using the &lt;strong&gt;Model Context Protocol (MCP)&lt;/strong&gt; is to explore the official MCP documentation and open-source repositories. Organizations like &lt;strong&gt;Anthropic&lt;/strong&gt; have already laid the groundwork, providing detailed specifications and SDKs for languages like Python and Java. Whether you're building an agent from scratch or plugging into an existing system like &lt;strong&gt;Copilot Studio&lt;/strong&gt; , the setup process is fairly straightforward.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Set Up an MCP Server
&lt;/h3&gt;

&lt;p&gt;Your first move is to deploy or install an MCP server connected to the tools or data sources you want your model to access. Anthropic and other contributors offer a library of pre-built MCP servers for popular services like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Google Drive, Gmail, and Calendar&lt;/li&gt;
&lt;li&gt;Slack (chat and file APIs)&lt;/li&gt;
&lt;li&gt;GitHub and Git repos&lt;/li&gt;
&lt;li&gt;SQL databases like Postgres&lt;/li&gt;
&lt;li&gt;Web browsers and automation tools like Puppeteer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can usually get started by cloning the server’s repo, installing dependencies, and configuring credentials (like API keys or tokens). Many setups are as easy as running a single CLI command.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Connect the MCP Client
&lt;/h3&gt;

&lt;p&gt;Once your MCP server is live, it’s time to wire it into your LLM or agent framework. If you’re using a hosted AI platform like Claude Desktop or Copilot Studio, this may involve entering the server address into a settings UI. For developers building their own tools, the MCP SDK allows you to instantiate a client, register your tool server’s endpoint, and start interacting with it programmatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Enable and Extend the Capabilities
&lt;/h3&gt;

&lt;p&gt;After setup, your MCP-aware model client will automatically discover the registered tools and enhance its abilities—adding new function calls, prompt templates, or dynamic context inputs based on what the server provides. You don’t need to hand-craft every interaction; the model knows how to interpret what’s available and use it as needed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Invoke and Iterate
&lt;/h3&gt;

&lt;p&gt;Now you're ready to test it out. Ask your AI model to perform a task that requires tool usage (e.g., “Summarize the latest emails from my team” or “Find the last edited Google Doc”). Watch the MCP logs to verify that your requests are reaching the server and that responses are flowing back. You’ll see real-time interaction between the LLM and your toolset—fully mediated by MCP.&lt;/p&gt;

&lt;p&gt;Now that you know how to get started, let’s look at why this protocol matters so much for modern AI development.&lt;/p&gt;

&lt;p&gt;&amp;lt;!--kg-card-end: markdown--&amp;gt;&amp;lt;!--kg-card-begin: markdown--&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How MCP Can Be Used in Web Scraping
&lt;/h2&gt;

&lt;p&gt;Web scraping is a valuable method for gathering real-time data, but integrating that data into AI systems often requires complex transformations. With the Model Context Protocol (MCP), scraping tools can act as context providers, delivering structured data directly to language models at inference time.&lt;/p&gt;

&lt;p&gt;This approach simplifies how scraped content—like product listings, headlines, or reviews—is used by AI. Instead of embedding raw HTML into prompts, the MCP server formats scraped data into a standardized context format. When the model is prompted, it receives clean, relevant context without extra processing.&lt;/p&gt;

&lt;p&gt;&amp;lt;!--kg-card-end: markdown--&amp;gt;&amp;lt;!--kg-card-begin: markdown--&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Power-up using Scrapfly
&lt;/h2&gt;

&lt;p&gt;ScrapFly provides &lt;a href="https://scrapfly.io/docs/scrape-api/getting-started" rel="noopener noreferrer"&gt;web scraping&lt;/a&gt;, &lt;a href="https://scrapfly.io/docs/screenshot-api/getting-started" rel="noopener noreferrer"&gt;screenshot&lt;/a&gt;, and &lt;a href="https://scrapfly.io/docs/extraction-api/getting-started" rel="noopener noreferrer"&gt;extraction&lt;/a&gt; APIs for data collection at scale.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/anti-scraping-protection" rel="noopener noreferrer"&gt;Anti-bot protection bypass&lt;/a&gt; - scrape web pages without blocking!&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/proxy" rel="noopener noreferrer"&gt;Rotating residential proxies&lt;/a&gt; - prevent IP address and geographic blocks.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/javascript-rendering" rel="noopener noreferrer"&gt;JavaScript rendering&lt;/a&gt; - scrape dynamic web pages through cloud browsers.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/javascript-scenario" rel="noopener noreferrer"&gt;Full browser automation&lt;/a&gt; - control browsers to scroll, input and click on objects.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/getting-started#api_param_format" rel="noopener noreferrer"&gt;Format conversion&lt;/a&gt; - scrape as HTML, JSON, Text, or Markdown.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/sdk/python" rel="noopener noreferrer"&gt;Python&lt;/a&gt; and &lt;a href="https://scrapfly.io/docs/sdk/typescript" rel="noopener noreferrer"&gt;Typescript&lt;/a&gt; SDKs, as well as &lt;a href="https://scrapfly.io/docs/sdk/scrapy" rel="noopener noreferrer"&gt;Scrapy&lt;/a&gt; and &lt;a href="https://scrapfly.io/docs/integration/getting-started" rel="noopener noreferrer"&gt;no-code tool integrations&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fcommon_scrapfly-api.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fcommon_scrapfly-api.svg" alt="What Is MCP? Understanding the Model Context Protocol" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scrapfly.io/register" rel="noopener noreferrer"&gt;Try for FREE!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scrapfly.io/docs" rel="noopener noreferrer"&gt;More on Scrapfly&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;!--kg-card-end: markdown--&amp;gt;&amp;lt;!--kg-card-begin: markdown--&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Popular MCP Servers You Should Know
&lt;/h2&gt;

&lt;p&gt;MCP supports a growing list of tool integrations, making it easy to connect AI models with real-world services. Here are some of the most popular MCP servers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Google Drive, Slack, GitHub, and Postgres&lt;/strong&gt; – Access files, chats, code, and databases directly from your AI agent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fetch and Puppeteer&lt;/strong&gt; – For scraping and reading web content in real-time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stripe, Spotify, Todoist&lt;/strong&gt; – Manage payments, playlists, and tasks through natural language.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker and Kubernetes&lt;/strong&gt; – Let your model interact with DevOps environments.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These tools show how flexible MCP is—whether you're building AI for research, automation, or everyday productivity. You can explore more at &lt;a href="https://modelcontextprotocol.io/examples" rel="noopener noreferrer"&gt;modelcontextprotocol.io/examples&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&amp;lt;!--kg-card-end: markdown--&amp;gt;&amp;lt;!--kg-card-begin: markdown--&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;Below are quick answers to common questions about the Model Context Protocol (MCP) and its uses.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I build my own MCP server?
&lt;/h3&gt;

&lt;p&gt;Yes! MCP is designed to be modular and developer-friendly. You can build a custom server using the open-source SDKs, often by wrapping an existing tool or API in a standardized format.&lt;/p&gt;

&lt;h3&gt;
  
  
  What languages does MCP support?
&lt;/h3&gt;

&lt;p&gt;The official MCP SDKs are currently available in Python and Java, with more language support expected as the ecosystem grows.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is MCP secure for enterprise use?
&lt;/h3&gt;

&lt;p&gt;Yes. MCP supports role-aware access control and data filtering, ensuring users only access the context they’re authorized to see—making it suitable for secure, enterprise-scale applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Model Context Protocol (MCP)&lt;/strong&gt; represents a major shift in how AI systems access and use external data. It enables tools, APIs, and documents to act as live context providers for large language models, replacing hardcoded prompts and brittle plugins with a standardized, scalable system. Whether you're integrating file systems, web scraping tools, or enterprise databases, MCP allows your AI to operate with richer, real-time awareness.&lt;/p&gt;

&lt;p&gt;We explored how MCP works, how to get started, and how it's being used across fields like DevOps, productivity, and even scraping. With growing community support and a robust library of MCP servers, it's never been easier to build smarter, context-aware AI applications.&lt;/p&gt;

</description>
      <category>ai</category>
    </item>
    <item>
      <title>Build a Proxy API: Rotate Proxies and Save Bandwidth</title>
      <dc:creator>Scrapfly</dc:creator>
      <pubDate>Mon, 31 Mar 2025 23:13:48 +0000</pubDate>
      <link>https://dev.to/scrapfly_dev/build-a-proxy-api-rotate-proxies-and-save-bandwidth-188e</link>
      <guid>https://dev.to/scrapfly_dev/build-a-proxy-api-rotate-proxies-and-save-bandwidth-188e</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fob87ohcdmammgzsh6dyq.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fob87ohcdmammgzsh6dyq.webp" alt="Build a Proxy API: Rotate Proxies and Save Bandwidth" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;!--kg-card-begin: markdown--&amp;gt; &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvhjyxha3i84lduy9t6p4.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvhjyxha3i84lduy9t6p4.webp" alt="Build a Proxy API: Rotate Proxies and Save Bandwidth" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;APIs can consume significant bandwidth, especially when multiple clients or services are fetching the same resources repeatedly. One way to reduce this overhead is by using a &lt;strong&gt;proxy API&lt;/strong&gt; – an intermediary that sits between your application and external APIs or websites. A proxy API can cache responses and filter out unnecessary data, saving bandwidth and speeding up requests for all clients that use it.&lt;/p&gt;

&lt;p&gt;In this tutorial, we'll walk through building a simple API proxy in Python using mitmproxy, a powerful open-source MITM (man-in-the-middle) proxy tool. By rotating proxies on each request and caching responses, our proxy will help avoid IP blocks and reduce duplicate data transfers. We’ll also configure it to drop unwanted resources (like images or styles) to further conserve bandwidth. Let’s dive into the benefits of rotating proxies and how to set up this bandwidth-saving proxy tool.&lt;/p&gt;

&lt;p&gt;&amp;lt;!--kg-card-end: markdown--&amp;gt;&amp;lt;!--kg-card-begin: markdown--&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is a Proxy API and Why Is It Useful?
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;proxy API&lt;/strong&gt; is a server that forwards API requests from clients to external services. Instead of directly contacting the target API or website, your application sends requests through the proxy, which may modify requests, manage authentication, caching, or IP rotation, and then returns responses to your application.&lt;/p&gt;

&lt;p&gt;Proxy APIs offer several key benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Privacy:&lt;/strong&gt; Conceal your application's IP address.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Centralized control:&lt;/strong&gt; Simplify logging, rate limiting, and caching.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Efficiency:&lt;/strong&gt; Reduce bandwidth usage and improve response reliability through caching.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexibility:&lt;/strong&gt; Easily manage API rate limits and bypass IP restrictions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Understanding these advantages helps highlight the essential features needed for building an effective proxy API, which we'll explore next.&lt;/p&gt;

&lt;p&gt;&amp;lt;!--kg-card-end: markdown--&amp;gt;&amp;lt;!--kg-card-begin: markdown--&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Features of a Good Proxy API
&lt;/h2&gt;

&lt;p&gt;Not all proxies are created equal. A good proxy API for bandwidth saving and web scraping tasks should include a few important features out of the box. Below are some key features and why they matter:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Feature&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Purpose &amp;amp; Benefit&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Proxy Rotation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Use a pool of IP proxies and rotate them on each request. This prevents any single proxy from being overused and getting blocked, ensuring higher availability and fewer captchas or bans. It also distributes traffic load across multiple IPs.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Response Caching&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Store responses (e.g., API results or webpage content) and serve them for identical requests. Caching avoids redundant downloads of the same data, significantly saving bandwidth and improving response times for repeated queries.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Content Filtering&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Drop or ignore unnecessary resource requests like images, CSS, or ads. By filtering out these non-critical assets, the proxy saves bandwidth and focuses on the data that your application actually needs (e.g. HTML or API JSON).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;HTTPS Support&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Intercept and handle HTTPS traffic by using trusted certificates. Full HTTPS support ensures even secure API calls can be proxied, while still allowing the proxy to inspect and cache their content.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These features combined make a proxy API both efficient and resilient. Proxy rotation keeps your scraping or API consumption stealthy and unblockable. Caching and filtering make it lightweight on bandwidth usage. In the next section, we'll start building our own proxy API step by step with Python and mitmproxy, incorporating each of these features.&lt;/p&gt;

&lt;p&gt;Now that we've identified what we need (rotation, caching, filtering, etc.), it's time to get our hands dirty and build the proxy API with these capabilities.&lt;/p&gt;

&lt;p&gt;&amp;lt;!--kg-card-end: markdown--&amp;gt;&amp;lt;!--kg-card-begin: markdown--&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Set Up mitmproxy in Python
&lt;/h2&gt;

&lt;p&gt;To build our proxy API, we'll use mitmproxy, a Python-based intercepting proxy. Mitmproxy can be scripted with Python addons to modify requests and responses on the fly. First, let's install mitmproxy and create a basic addon script to ensure everything is wired up correctly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Install mitmproxy via pip if you haven't already
$ pip install mitmproxy

# (Optional) Verify the installation by checking the version
$ mitmproxy --version

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we'll set up a simple mitmproxy addon in Python. Create a file (for example, &lt;code&gt;proxy_tool.py&lt;/code&gt;) and add a basic class that will handle proxy events. For now, we'll just log each request to confirm our proxy is intercepting traffic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from mitmproxy import http

class BandwidthSaver:
    def request(self, flow: http.HTTPFlow):
        # Log each incoming request URL (for debugging purposes)
        print("Request URL:", flow.request.pretty_url)

# Register the addon with mitmproxy
addons = [BandwidthSaver()]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this snippet, we import mitmproxy's &lt;code&gt;http&lt;/code&gt; module and define a class &lt;code&gt;BandwidthSaver&lt;/code&gt; with a &lt;code&gt;request&lt;/code&gt; method. Mitmproxy will call &lt;code&gt;request()&lt;/code&gt; for every HTTP request passing through the proxy. Here we simply print the URL of the request (&lt;code&gt;flow.request.pretty_url&lt;/code&gt;) to the console. The last line registers our class as a mitmproxy addon.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Running the proxy:&lt;/strong&gt; To test this setup, run mitmproxy (or its console-less variant &lt;code&gt;mitmdump&lt;/code&gt;) with the addon script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ mitmdump -s proxy_tool.py

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Example Output
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
[20:01:58.311] Loading script proxy_tool.py
[20:01:58.311] HTTP(S) proxy listening at *:8080.

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By default, mitmproxy listens on &lt;strong&gt;localhost:8080&lt;/strong&gt; as an HTTP proxy. Configure your application or browser to use &lt;code&gt;localhost:8080&lt;/code&gt; as the HTTP/HTTPS proxy and perform a request (for example, open a webpage or make an API call). You should see the request URLs being printed by our script. This confirms the proxy is intercepting requests successfully.&lt;/p&gt;

&lt;p&gt;With mitmproxy installed and our basic addon logging requests, we have the foundation ready. Next, we'll ensure HTTPS traffic can be handled by our proxy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Enable HTTPS by Installing mitmproxy’s Certificate
&lt;/h2&gt;

&lt;p&gt;Modern APIs and websites mostly use HTTPS. For our proxy API to inspect and cache those requests, we need to enable HTTPS interception. Mitmproxy does this by acting as a "man-in-the-middle" with its own Certificate Authority (CA). We must install mitmproxy's CA certificate on the client system so that it trusts the proxy for HTTPS connections.&lt;/p&gt;

&lt;p&gt;First, start mitmproxy (or mitmdump) to generate the necessary certificates if not already done:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ mitmproxy # Start the proxy; it will generate a CA cert on first run

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While mitmproxy is running, open a web browser (or use your device) and visit &lt;a href="http://mitm.it" rel="noopener noreferrer"&gt;&lt;strong&gt;http://mitm.it&lt;/strong&gt;&lt;/a&gt;. This special page provides instructions to download and install the mitmproxy CA certificate for various platforms (Windows, macOS, Linux, Android, iOS). &lt;strong&gt;Install the certificate&lt;/strong&gt; according to your environment. This typically involves trusting a new CA in your system or browser settings.&lt;/p&gt;

&lt;p&gt;Once the certificate is installed, your system will treat the mitmproxy as a trusted authority. This means mitmproxy can decrypt HTTPS traffic between clients and servers, allowing our addon to read and modify those requests and responses. &lt;strong&gt;HTTPS support is now enabled&lt;/strong&gt; for our proxy API.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Only install the mitmproxy certificate on devices or environments you control for development or scraping. It gives the proxy power to intercept secure communications, which should be used responsibly.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;With the proxy set up and HTTPS enabled, we can proceed to implement the core features of our bandwidth-saving proxy API. Next, we'll add functionality to &lt;strong&gt;rotate upstream proxies&lt;/strong&gt; for each request.&lt;/p&gt;

&lt;p&gt;Now that secure traffic can flow through our proxy, we’re ready to enhance it with proxy rotation for better IP diversity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Rotate Proxies Randomly on Each Request
&lt;/h2&gt;

&lt;p&gt;One major benefit of a proxy API is the ability to hide the client's IP address. We can take this further by rotating through a list of upstream proxy servers on every request. By doing so, each request appears to come from a different IP—helping avoid rate limits or bans on the target service. Mitmproxy supports forwarding requests to an upstream proxy, which we can control in our script.&lt;/p&gt;

&lt;p&gt;Let's update our addon to choose a random proxy for each request. Suppose we have a list of proxy server addresses (IP:port or host:port). We’ll configure mitmproxy to use one by default and then override it per request in our script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import random
from mitmproxy import http

class BandwidthSaver:
    # List of upstream proxy servers to rotate through
    upstream_proxies = [
        "203.0.113.10:3128",
        "198.51.100.23:3128",
        "203.0.113.47:3128",
        # ... add as many proxies (IP:port or host:port) as you have
    ]

    def request(self, flow: http.HTTPFlow):
        # Pick a random upstream proxy for this request
        proxy_address = random.choice(self.upstream_proxies)
        host, port = proxy_address.split(":")
        # In upstream mode, tell mitmproxy to use the chosen proxy
        if flow.live:
            flow.live.change_upstream_proxy_server((host, int(port)))

        # (Optional) Log which proxy was chosen for debugging
        print(f"→ Rotating via proxy: {proxy_address} for {flow.request.host}")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this code, we added an &lt;code&gt;upstream_proxies&lt;/code&gt; list to our class containing proxy server addresses (you would replace these example IPs with actual proxies you have access to). In the &lt;code&gt;request&lt;/code&gt; method, we use Python's &lt;code&gt;random.choice&lt;/code&gt; to select a proxy from the list for each incoming request. The &lt;code&gt;flow.live.change_upstream_proxy_server((host, port))&lt;/code&gt; call tells mitmproxy to forward the current request through that upstream proxy.&lt;/p&gt;

&lt;p&gt;A couple of important notes for this to work:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Start mitmproxy in upstream mode&lt;/strong&gt; : When launching mitmdump or mitmproxy, use the &lt;code&gt;--mode upstream:&lt;/code&gt; option with any proxy (or a default one) specified. For example:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;HTTPS requests&lt;/strong&gt; : The rotation logic above works for both HTTP and HTTPS requests, now that we've installed the certificate. Mitmproxy will decrypt the HTTPS request, then re-encrypt it as it passes it to the chosen upstream proxy.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With proxy rotation in place, every request through our proxy API will emerge from a random IP address. This helps distribute traffic and avoid IP-based blocking. For example, if you're scraping a website that limits one request per second per IP, using five rotating proxies could effectively allow ~5 requests per second without triggering blocks.&lt;/p&gt;

&lt;p&gt;At this stage, our proxy API is forwarding requests through random proxies, enhancing anonymity and reliability. Next, we'll implement response caching to reuse results and save more bandwidth.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Cache Responses to Save Bandwidth
&lt;/h2&gt;

&lt;p&gt;Caching is a crucial feature for saving bandwidth. If multiple clients request the same resource through our proxy API, there's no need to fetch it from the origin server every time – we can return a stored copy. Let's add a simple cache to our proxy using a Python dictionary to store responses.&lt;/p&gt;

&lt;p&gt;We'll cache responses by URL. When a request comes in, the addon will first check if we have a cached response for that URL. If yes, it will immediately return the cached data without forwarding the request to the internet. If not, it will proceed normally (possibly using a rotated proxy upstream), and then save the response for next time.&lt;/p&gt;

&lt;p&gt;Here's how we can integrate caching into our &lt;code&gt;BandwidthSaver&lt;/code&gt; addon:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from mitmproxy import http
import random

class BandwidthSaver:
    upstream_proxies = [
        "203.0.113.10:3128",
        "198.51.100.23:3128",
        "203.0.113.47:3128",
        # ... (same proxy list as before)
    ]
    # Initialize an in-memory cache (dictionary)
    cache = {}

    def request(self, flow: http.HTTPFlow):
        # 1. If this URL was seen before and cached, serve it from cache
        if flow.request.pretty_url in self.cache:
            cached_resp = self.cache[flow.request.pretty_url]
            # Create a response directly from cache without contacting upstream
            flow.response = http.HTTPResponse.make(
                cached_resp["status_code"], # e.g. 200
                cached_resp["content"], # cached raw content (bytes)
                cached_resp["headers"] # cached headers
            )
            return # respond from cache, no need to forward request

        # 2. Not cached: pick a random proxy as in Step 3
        proxy_address = random.choice(self.upstream_proxies)
        host, port = proxy_address.split(":")
        if flow.live:
            flow.live.change_upstream_proxy_server((host, int(port)))
        # (The request will now be forwarded to the origin through the chosen proxy)

    def response(self, flow: http.HTTPFlow):
        # After receiving a response from origin, cache it for future requests
        url = flow.request.pretty_url
        if url not in self.cache:
            self.cache[url] = {
                "status_code": flow.response.status_code,
                "content": flow.response.content, # raw bytes of the response body
                "headers": dict(flow.response.headers)
            }
            # (Now the next request for the same URL will hit the cache)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's break down the caching logic:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;We added a class attribute &lt;code&gt;cache&lt;/code&gt; as a dictionary to store responses by URL. In a real scenario, you might want a more robust cache with size limits or expiration, but this simple dict will do for demonstration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cache check in &lt;code&gt;request&lt;/code&gt;:&lt;/strong&gt; Before forwarding a request, we check if &lt;code&gt;flow.request.pretty_url&lt;/code&gt; (the full URL as a string) exists in our &lt;code&gt;cache&lt;/code&gt;. If it does, we retrieve the cached data and use &lt;code&gt;http.HTTPResponse.make(...)&lt;/code&gt; to create a synthetic response. We supply the cached status code, content, and headers. Setting &lt;code&gt;flow.response&lt;/code&gt; in the request phase like this short-circuits the request – the client will get the response immediately from our proxy, and mitmproxy will not forward the request to the upstream server.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Saving in &lt;code&gt;response&lt;/code&gt;:&lt;/strong&gt; If the request was not cached, it went out to the origin (through a proxy). In the &lt;code&gt;response&lt;/code&gt; handler, we take the newly received response and store it in the cache dict. We use the same URL as key. We store the status code, the content (which is a bytes object for the body), and the headers (converted to a regular dict for simplicity). Next time the same URL is requested, the &lt;code&gt;request&lt;/code&gt; method will find it in &lt;code&gt;cache&lt;/code&gt; and return this data.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With caching enabled, repeated requests for the same resource will be served from the proxy API's memory instead of the network. This saves bandwidth because the data travels only once from the external server; subsequent requests get the data from the local cache. It also reduces latency for those requests since returning data from memory is faster than making a network round-trip.&lt;/p&gt;

&lt;p&gt;For example, if client A requests &lt;code&gt;https://api.example.com/data?id=123&lt;/code&gt; and then client B (or even A again) requests the same URL, the second request will get an instant cached response. No outgoing proxy usage or internet bandwidth is needed for the second call.&lt;/p&gt;

&lt;p&gt;Now our proxy API rotates proxies and caches responses, making it efficient and fast for repeated requests. Next, we'll add a final touch: filtering out unnecessary requests to conserve even more bandwidth.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Drop Unnecessary Requests (Stylesheets &amp;amp; Images)
&lt;/h2&gt;

&lt;p&gt;When proxying web content (as opposed to pure API JSON), browsers often try to fetch images, stylesheets, scripts, and other assets. In a scraping context, these usually aren't needed – they just waste bandwidth. Our proxy API can proactively drop such requests. Even for API use cases, there might be certain endpoints or file types you know are extraneous. By filtering them out, the proxy saves the client from downloading useless data.&lt;/p&gt;

&lt;p&gt;We'll update the &lt;code&gt;request&lt;/code&gt; method in our addon to identify requests for common static asset types (like images and CSS) and short-circuit them with an empty response. This should happen before the caching check or proxy forwarding:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    def request(self, flow: http.HTTPFlow):
        # 0. Filter out unwanted asset types to save bandwidth
        if flow.request.pretty_url.endswith((".png", ".jpg", ".jpeg", ".gif", ".css", ".js")):
            # Return an empty 204 No Content response for these requests
            flow.response = http.HTTPResponse.make(204, b"", {})
            return

        # 1. Serve from cache if available (as implemented in Step 4)
        if flow.request.pretty_url in self.cache:
            cached_resp = self.cache[flow.request.pretty_url]
            flow.response = http.HTTPResponse.make(
                cached_resp["status_code"],
                cached_resp["content"],
                cached_resp["headers"]
            )
            return

        # 2. Otherwise, rotate proxy and forward (from Step 3)
        proxy_address = random.choice(self.upstream_proxies)
        host, port = proxy_address.split(":")
        if flow.live:
            flow.live.change_upstream_proxy_server((host, int(port)))

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The new addition here is the first &lt;code&gt;if&lt;/code&gt; block: it checks the URL's suffix against a tuple of file extensions for images (&lt;code&gt;.png, .jpg, .jpeg, .gif&lt;/code&gt;), stylesheets (&lt;code&gt;.css&lt;/code&gt;), and scripts (&lt;code&gt;.js&lt;/code&gt;). You can adjust this list based on what you consider "unnecessary" for your scenario. If a match is found, we immediately set &lt;code&gt;flow.response&lt;/code&gt; to an HTTP 204 (No Content) with an empty body. A 204 status tells the client that the request succeeded but there's no content to load. We then &lt;code&gt;return&lt;/code&gt; without forwarding the request further. The result is that, for example, if a webpage tries to load a large &lt;code&gt;.png&lt;/code&gt; image, our proxy will respond with nothing (saving the bandwidth that would have been used to download the image).&lt;/p&gt;

&lt;p&gt;After adding this filter, the rest of the logic remains the same: we check the cache, and if not cached, we forward the request through a rotated proxy. The &lt;code&gt;response&lt;/code&gt; handler also remains as implemented in Step 4 (caching any new responses). We typically don't need to cache the dropped items since we never fetch them in the first place.&lt;/p&gt;

&lt;p&gt;With this final step, our proxy API tool is quite complete. It rotates among multiple upstream proxies, caches responses to reuse data, and blocks superfluous asset requests. All these measures contribute to &lt;strong&gt;substantial bandwidth savings&lt;/strong&gt; and can speed up your data fetching pipelines.&lt;/p&gt;

&lt;p&gt;To run the full proxy with all features combined, use the script and start mitmproxy as before. For instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ mitmdump --mode upstream:http://203.0.113.10:3128 -s proxy_tool.py

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember to update the &lt;code&gt;upstream_proxies&lt;/code&gt; list in the script with proxies you have. Also ensure your clients are configured to use the mitmproxy server (e.g., &lt;code&gt;HTTP_PROXY&lt;/code&gt; environment variable or browser proxy settings pointing to &lt;code&gt;localhost:8080&lt;/code&gt;). Once running, your proxy API will handle incoming requests according to the logic we implemented.&lt;/p&gt;

&lt;p&gt;We have now built a functional proxy API that can be used as a drop-in bandwidth-saving layer for web scraping or API consumption.&lt;/p&gt;

&lt;p&gt;&amp;lt;!--kg-card-end: markdown--&amp;gt;&amp;lt;!--kg-card-begin: markdown--&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Proxies at ScrapFly
&lt;/h2&gt;

&lt;p&gt;ScrapFly provides &lt;a href="https://scrapfly.io/docs/scrape-api/getting-started" rel="noopener noreferrer"&gt;web scraping&lt;/a&gt;, &lt;a href="https://scrapfly.io/docs/screenshot-api/getting-started" rel="noopener noreferrer"&gt;screenshot&lt;/a&gt;, and &lt;a href="https://scrapfly.io/docs/extraction-api/getting-started" rel="noopener noreferrer"&gt;extraction&lt;/a&gt; APIs for data collection at scale.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/anti-scraping-protection" rel="noopener noreferrer"&gt;Anti-bot protection bypass&lt;/a&gt; - scrape web pages without blocking!&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/proxy" rel="noopener noreferrer"&gt;Rotating residential proxies&lt;/a&gt; - prevent IP address and geographic blocks.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/javascript-rendering" rel="noopener noreferrer"&gt;JavaScript rendering&lt;/a&gt; - scrape dynamic web pages through cloud browsers.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/javascript-scenario" rel="noopener noreferrer"&gt;Full browser automation&lt;/a&gt; - control browsers to scroll, input and click on objects.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/getting-started#api_param_format" rel="noopener noreferrer"&gt;Format conversion&lt;/a&gt; - scrape as HTML, JSON, Text, or Markdown.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/sdk/python" rel="noopener noreferrer"&gt;Python&lt;/a&gt; and &lt;a href="https://scrapfly.io/docs/sdk/typescript" rel="noopener noreferrer"&gt;Typescript&lt;/a&gt; SDKs, as well as &lt;a href="https://scrapfly.io/docs/sdk/scrapy" rel="noopener noreferrer"&gt;Scrapy&lt;/a&gt; and &lt;a href="https://scrapfly.io/docs/integration/getting-started" rel="noopener noreferrer"&gt;no-code tool integrations&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fcommon_scrapfly-api.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fcommon_scrapfly-api.svg" alt="Build a Proxy API: Rotate Proxies and Save Bandwidth" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scrapfly.io/register" rel="noopener noreferrer"&gt;Try for FREE!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scrapfly.io/docs" rel="noopener noreferrer"&gt;More on Scrapfly&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What is a Proxy API?
&lt;/h3&gt;

&lt;p&gt;A proxy API is a server that forwards requests from clients to external services, optionally modifying requests and responses (e.g., adding caching or authentication). It helps hide client details, enforce policies, and aggregate data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why use rotating proxies in a proxy API?
&lt;/h3&gt;

&lt;p&gt;Rotating proxies distribute requests across different IPs, preventing rate-limiting and bans when scraping or accessing restricted APIs. This ensures reliability and higher request volume.&lt;/p&gt;

&lt;h3&gt;
  
  
  How does caching in a proxy API save bandwidth?
&lt;/h3&gt;

&lt;p&gt;Caching stores responses locally on the proxy. Subsequent identical requests use cached responses rather than fetching again from external services, significantly reducing bandwidth usage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In this article, we built a bandwidth-saving proxy API from scratch using Python and mitmproxy. We started by setting up mitmproxy and enabling HTTPS interception so that we could handle secure traffic. Then we added proxy rotation, allowing each request to exit through a different IP address to avoid rate limits and blocking. Next, we implemented a simple in-memory cache to store responses and serve repeated requests without re-downloading data. We also introduced a filtering mechanism to drop unnecessary resources like images and styles, conserving bandwidth further.&lt;/p&gt;

</description>
      <category>proxies</category>
      <category>api</category>
    </item>
    <item>
      <title>The Best Datacenter Proxies in 2025: A Complete Guide</title>
      <dc:creator>Scrapfly</dc:creator>
      <pubDate>Tue, 25 Mar 2025 12:53:35 +0000</pubDate>
      <link>https://dev.to/scrapfly_dev/the-best-datacenter-proxies-in-2025-a-complete-guide-209n</link>
      <guid>https://dev.to/scrapfly_dev/the-best-datacenter-proxies-in-2025-a-complete-guide-209n</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2F2025%2F03%2Fdatacenter-proxies-white-bg.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2F2025%2F03%2Fdatacenter-proxies-white-bg.svg" alt="The Best Datacenter Proxies in 2025: A Complete Guide" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Datacenter proxies are a top choice for web scraping, automation, and online anonymity thanks to their speed, low cost, and scalability. Whether you're scaling a scraping operation, grabbing limited Supreme drops, or testing with free data center proxies, there's a setup for every use case.&lt;/p&gt;

&lt;p&gt;In this article, we'll dive into what datacenter proxies are, how they compare to residential and mobile proxies, and which services currently offer the best bang for your buck. and highlight top providers like &lt;a href="https://iproyal.com/" rel="noopener noreferrer"&gt;IPRoyal&lt;/a&gt; and &lt;a href="https://proxy-seller.com/" rel="noopener noreferrer"&gt;Razorproxy&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  What Are Datacenter Proxies?
&lt;/h2&gt;

&lt;p&gt;Datacenter proxies are IP addresses provided by servers hosted in data centers. Unlike residential proxies, which are tied to real devices and ISPs, these proxies are not associated with a physical location or end user. This makes them incredibly fast and reliable, but also more detectable by websites with strong anti-bot systems.&lt;/p&gt;
&lt;h3&gt;
  
  
  What Are the Types of Datacenter Proxies?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Shared datacenter proxies&lt;/strong&gt; are used by multiple clients simultaneously. They're more affordable and ideal for low-risk tasks like general scraping or data gathering. However, since the IPs are shared, there's a higher chance of detection and IP bans.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dedicated datacenter proxies&lt;/strong&gt; are assigned to a single user, offering greater stability, speed, and security. They're the better choice for sensitive tasks like account creation, sneaker botting, or large-scale scraping that require consistent performance.&lt;/p&gt;

&lt;p&gt;Now that you understand what they are, let’s explore why and when you should choose datacenter proxies over other types.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why Choose Datacenter Proxies?
&lt;/h2&gt;

&lt;p&gt;Datacenter proxies stand out for their speed, affordability, and scalability. They can be deployed in bulk, making them ideal for handling high-volume, data-intensive tasks. Whether you're running a scraping operation or automating e-commerce tasks, these proxies offer the performance you need at a fraction of the cost of residential or mobile proxies.&lt;/p&gt;

&lt;p&gt;Here are some key use cases where datacenter proxies shine:&lt;/p&gt;
&lt;h3&gt;
  
  
  Web Scraping at Scale
&lt;/h3&gt;

&lt;p&gt;Providers like IPRoyal and Razorproxy offer flexible, high-performance plans that support thousands of requests per second. This makes datacenter proxies a top choice for collecting data at scale without worrying about bandwidth limitations or speed bottlenecks.&lt;/p&gt;
&lt;h3&gt;
  
  
  Bypassing Geo-Restrictions
&lt;/h3&gt;

&lt;p&gt;Even though they aren't linked to real user devices, EU datacenter proxies can still help access location-specific content. They're especially useful for testing localized versions of websites or gathering data from different regions for compliance and market research.&lt;/p&gt;
&lt;h3&gt;
  
  
  E-commerce Automation
&lt;/h3&gt;

&lt;p&gt;Speed and reliability are crucial when it comes to automated purchasing or monitoring stock. That’s why datacenter proxies are considered the best proxies for Supreme drops and similar high-stakes e-commerce scenarios they keep your bots running fast and smooth under pressure.&lt;/p&gt;

&lt;p&gt;Whether you’re looking to buy dedicated proxy access, try out free data center proxies, or go for unlimited bandwidth proxies, there’s a setup that fits your use case and budget.&lt;/p&gt;

&lt;p&gt;Now that we've covered the benefits, let’s break down the differences between shared and dedicated datacenter proxies.&lt;/p&gt;
&lt;h2&gt;
  
  
  Shared vs Dedicated Datacenter Proxies
&lt;/h2&gt;

&lt;p&gt;When choosing the best datacenter proxies, it’s important to understand the difference between &lt;strong&gt;shared&lt;/strong&gt; and &lt;strong&gt;dedicated&lt;/strong&gt; options. Each serves different needs, and the right choice depends on your use case, budget, and performance requirements.&lt;/p&gt;
&lt;h3&gt;
  
  
  Shared Datacenter Proxies
&lt;/h3&gt;

&lt;p&gt;Shared datacenter proxies are IP addresses that are used simultaneously by multiple users. Because of this, they’re much more affordable, making them a great entry-level option for individuals or small teams working on non-sensitive tasks.&lt;/p&gt;

&lt;p&gt;These proxies are well-suited for activities like keyword tracking, market research, or scraping publicly available data where speed and full anonymity aren’t critical. However, since several users may be using the same IP at once, websites can flag or block them more easily, especially if abuse is detected.&lt;/p&gt;

&lt;p&gt;They’re a solid choice if you're looking to experiment with free data center proxies or run lightweight projects where occasional IP bans are acceptable.&lt;/p&gt;
&lt;h3&gt;
  
  
  Dedicated Datacenter Proxies
&lt;/h3&gt;

&lt;p&gt;Dedicated datacenter proxies are reserved for a single user, giving you full control and exclusive access to the IP. This greatly reduces the risk of bans, ensures more consistent performance, and allows you to manage session-based tasks more effectively.&lt;/p&gt;

&lt;p&gt;Because of their reliability and clean IP history, dedicated proxies are the preferred option for high-stakes applications like sneaker botting (such as copping drops from Supreme), login automation, social media account management, or solving captchas. They're also the go-to for businesses that need to run high-frequency scraping without interruptions.&lt;/p&gt;

&lt;p&gt;While they come at a higher cost, the stability, speed, and security they offer make them well worth the investment especially when paired with unlimited bandwidth proxies from providers like IPRoyal or Razorproxy.&lt;/p&gt;

&lt;p&gt;Here’s a side-by-side comparison to help you visualize the key differences:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Shared Proxies&lt;/th&gt;
&lt;th&gt;Dedicated Proxies&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Performance&lt;/td&gt;
&lt;td&gt;Moderate&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;Higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Risk of IP Ban&lt;/td&gt;
&lt;td&gt;Higher (shared usage)&lt;/td&gt;
&lt;td&gt;Lower (exclusive access)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ideal For&lt;/td&gt;
&lt;td&gt;General scraping, SEO, research&lt;/td&gt;
&lt;td&gt;Sneaker bots, login automation, account creation&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Now that you have a clearer understanding of both options, let's explore how to choose a good proxy provider that matches your goals.&lt;/p&gt;
&lt;h2&gt;
  
  
  What Makes a Good Proxy Provider?
&lt;/h2&gt;

&lt;p&gt;Selecting the right datacenter proxy provider is critical, especially if you're running high-volume scraping, automation, or e-commerce operations. Here are the key factors to consider when evaluating good proxy websites:&lt;/p&gt;
&lt;h3&gt;
  
  
  Speed and Bandwidth
&lt;/h3&gt;

&lt;p&gt;Performance is a top priority. If you're handling large-scale scraping or time-sensitive tasks, speed is essential. Look for providers that offer unlimited bandwidth to ensure consistent throughput without the risk of data limits or throttling.&lt;/p&gt;
&lt;h3&gt;
  
  
  Reliability and Uptime
&lt;/h3&gt;

&lt;p&gt;A dependable provider should offer at least 99.9% uptime. This ensures your operations run smoothly without frequent interruptions. Providers like Razorproxy are known for publishing infrastructure performance metrics, which is a good indicator of reliability and transparency.&lt;/p&gt;
&lt;h3&gt;
  
  
  IP Pool Diversity
&lt;/h3&gt;

&lt;p&gt;Access to a broad and diverse IP pool allows you to target multiple regions effectively. Look for providers offering EU datacenter proxies and other global locations, which can be valuable for tasks like localized testing, geo-restricted content access, or international market research.&lt;/p&gt;
&lt;h3&gt;
  
  
  Support and Developer Features
&lt;/h3&gt;

&lt;p&gt;If you're managing large or complex projects, advanced features can make a big difference. Look for providers that offer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Proxy rotation support&lt;/li&gt;
&lt;li&gt;API access for automation and monitoring&lt;/li&gt;
&lt;li&gt;Detailed usage statistics&lt;/li&gt;
&lt;li&gt;Flexible authentication options (IP whitelisting or user/password)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These capabilities provide better control, scalability, and efficiency, especially in technical or enterprise-level use cases.&lt;/p&gt;

&lt;p&gt;Before choosing a provider, consider starting with a trial or a low-commitment plan to evaluate real-world performance. This helps ensure the service meets your specific needs before scaling up.&lt;/p&gt;
&lt;h2&gt;
  
  
  Best Datacenter Proxy Providers in 2025
&lt;/h2&gt;

&lt;p&gt;Choosing the right provider depends on your specific needs whether you're testing the waters with free proxies, running high-frequency scrapers, or managing automation at scale.&lt;/p&gt;

&lt;p&gt;Below are some of the top-rated datacenter proxy providers for 2025, along with a comparison table to help guide your decision.&lt;/p&gt;
&lt;h3&gt;
  
  
  IPRoyal
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://iproyal.com/" rel="noopener noreferrer"&gt;IPRoyal&lt;/a&gt; is known for its affordability, user-friendly dashboard, and flexible plans. It's an excellent choice for individuals or small teams looking to get started with free data center proxies or scale gradually. Their shared and dedicated datacenter proxies are competitively priced, making them accessible for a wide range of users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; Entry-level users, budget-conscious scraping, and small-scale automation.&lt;/p&gt;
&lt;h3&gt;
  
  
  Razorproxy
&lt;/h3&gt;

&lt;p&gt;&lt;a href="//razorproxy.com"&gt;Razorproxy&lt;/a&gt; delivers premium performance with high-speed, low-latency proxies designed for serious use cases. It supports buy dedicated proxy access with unlimited bandwidth, making it a top pick for users running high-frequency scraping, sneaker bots, or e-commerce monitoring tools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt; Power users, large-scale scraping, and automation with zero tolerance for downtime.&lt;/p&gt;
&lt;h3&gt;
  
  
  Comparison Table: Top Datacenter Proxy Providers in 2025
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Provider&lt;/th&gt;
&lt;th&gt;Best For&lt;/th&gt;
&lt;th&gt;Bandwidth&lt;/th&gt;
&lt;th&gt;Speed&lt;/th&gt;
&lt;th&gt;Price Level&lt;/th&gt;
&lt;th&gt;Free Trial/Test&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;IPRoyal&lt;/td&gt;
&lt;td&gt;Beginners, small projects&lt;/td&gt;
&lt;td&gt;Unlimited (on paid plans)&lt;/td&gt;
&lt;td&gt;Fast&lt;/td&gt;
&lt;td&gt;Affordable&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Offers free data center proxies and flexible upgrades&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Razorproxy&lt;/td&gt;
&lt;td&gt;High-performance, automation&lt;/td&gt;
&lt;td&gt;Unlimited&lt;/td&gt;
&lt;td&gt;Very fast&lt;/td&gt;
&lt;td&gt;Moderate-High&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Great for real-time scraping, bots, and low latency use&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For more details on scraping strategies, proxy rotation, and privacy tools, check out this related article:&lt;/p&gt;

&lt;p&gt;[&lt;/p&gt;

&lt;p&gt;How to Use TOR for Web Scraping&lt;/p&gt;

&lt;p&gt;Learn about web scraping using Tor as a proxy and rotating proxy server by randomly changing the IP address with HTTP or SOCKS.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fhow-to-use-tor-for-web-scraping_banner_light.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fhow-to-use-tor-for-web-scraping_banner_light.svg" alt="The Best Datacenter Proxies in 2025: A Complete Guide" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
](&lt;a href="https://scrapfly.io/blog/how-to-use-web-scaping-for-rag-applications/" rel="noopener noreferrer"&gt;https://scrapfly.io/blog/how-to-use-web-scaping-for-rag-applications/&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Now that you know the top providers and how they compare, let’s look at how to integrate datacenter proxies into your workflow with a quick code example.&lt;/p&gt;
&lt;h2&gt;
  
  
  How to Use Datacenter Proxies in Code
&lt;/h2&gt;

&lt;p&gt;Using a datacenter proxy in your code is straightforward. Below is a simple Python example using the &lt;a href="https://pypi.org/project/requests/" rel="noopener noreferrer"&gt;requests&lt;/a&gt; library to send traffic through a proxy server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests

# Set up your proxy credentials and address
proxy = {
    'http': 'http://username:password@123.456.789.101:8080',
    'https': 'http://username:password@123.456.789.101:8080'
}

# Make a GET request using the proxy
response = requests.get('https://httpbin.org/ip', proxies=proxy)

print(response.text)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above code, we configured both HTTP and HTTPS traffic to go through a datacenter proxy. This is a basic way to test if your proxy is working. For larger projects, consider rotating proxies or using session management.&lt;/p&gt;

&lt;h2&gt;
  
  
  Proxies With ScrapFly
&lt;/h2&gt;

&lt;p&gt;ScrapFly is a web scraping API with &lt;a href="https://scrapfly.io/docs/scrape-api/proxy" rel="noopener noreferrer"&gt;residential proxies from over 50+ countries&lt;/a&gt;, which allows for avoiding IP throttling and blocking while also allowing for scraping from almost any geographical location.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fcommon_scrapfly-api.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fcommon_scrapfly-api.svg" alt="The Best Datacenter Proxies in 2025: A Complete Guide" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ScrapFly provides &lt;a href="https://scrapfly.io/docs/scrape-api/getting-started" rel="noopener noreferrer"&gt;web scraping&lt;/a&gt;, &lt;a href="https://scrapfly.io/docs/screenshot-api/getting-started" rel="noopener noreferrer"&gt;screenshot&lt;/a&gt;, and &lt;a href="https://scrapfly.io/docs/extraction-api/getting-started" rel="noopener noreferrer"&gt;extraction&lt;/a&gt; APIs for data collection at scale.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/anti-scraping-protection" rel="noopener noreferrer"&gt;Anti-bot protection bypass&lt;/a&gt; - scrape web pages without blocking!&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/proxy" rel="noopener noreferrer"&gt;Rotating residential proxies&lt;/a&gt; - prevent IP address and geographic blocks.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/javascript-rendering" rel="noopener noreferrer"&gt;JavaScript rendering&lt;/a&gt; - scrape dynamic web pages through cloud browsers.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/javascript-scenario" rel="noopener noreferrer"&gt;Full browser automation&lt;/a&gt; - control browsers to scroll, input and click on objects.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/getting-started#api_param_format" rel="noopener noreferrer"&gt;Format conversion&lt;/a&gt; - scrape as HTML, JSON, Text, or Markdown.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/sdk/python" rel="noopener noreferrer"&gt;Python&lt;/a&gt; and &lt;a href="https://scrapfly.io/docs/sdk/typescript" rel="noopener noreferrer"&gt;Typescript&lt;/a&gt; SDKs, as well as &lt;a href="https://scrapfly.io/docs/sdk/scrapy" rel="noopener noreferrer"&gt;Scrapy&lt;/a&gt; and &lt;a href="https://scrapfly.io/docs/integration/getting-started" rel="noopener noreferrer"&gt;no-code tool integrations&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is how we can use ScrapFly proxies to avoid web scraping blocking. All we have to do is select a proxy pool and enable the &lt;code&gt;asp&lt;/code&gt; argument:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from scrapfly import ScrapeConfig, ScrapflyClient, ScrapeApiResponse

scrapfly = ScrapflyClient(key="Your ScrapFly API key")

api_response: ScrapeApiResponse = scrapfly.scrape(
    ScrapeConfig(
        # target website URL
        url="https://www.leboncoin.fr",
        # select a proxy pool (residential or datacenter)
        proxy_pool="public_residential_pool",
        # Set the proxy location to a specific country
        country="FR",
        # JavaScript rendering, similar to headless browsers
        render_js=True,
        # Bypass anti scraping protection
        asp=True
    )
)
# Print the website's status code
print(api_response.upstream_status_code)
"200"

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://scrapfly.io/register" rel="noopener noreferrer"&gt;Try for FREE!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scrapfly.io/docs" rel="noopener noreferrer"&gt;More on Scrapfly&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQS
&lt;/h2&gt;

&lt;p&gt;Below are quick answers to common questions about datacenter proxies.&lt;/p&gt;

&lt;h3&gt;
  
  
  Are datacenter proxies safe to use?
&lt;/h3&gt;

&lt;p&gt;Yes, when purchased from reliable providers like IPRoyal or Razorproxy, datacenter proxies are safe and legal for most use cases like scraping and automation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I use free data center proxies?
&lt;/h3&gt;

&lt;p&gt;You can, but free proxies often come with slower speeds, limited uptime, and higher ban rates. Use them for testing or low-risk activities only.&lt;/p&gt;

&lt;h3&gt;
  
  
  What are good proxy websites to buy from?
&lt;/h3&gt;

&lt;p&gt;Some good proxy websites include IPRoyal, Razorproxy, Smartproxy, and Bright Data. Choose based on your budget and technical needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Datacenter proxies remain a powerful tool in 2025 for scraping, automation, and online tasks that demand speed and scalability. They’re cost-effective, fast, and easy to deploy especially for users who don’t need the complexity or price tag of residential proxies.&lt;/p&gt;

&lt;p&gt;Whether you're using shared proxies for basic scraping or dedicated proxies for high-stakes automation, providers like IPRoyal and Razorproxy offer flexible plans to suit every need.&lt;/p&gt;

</description>
      <category>proxies</category>
    </item>
    <item>
      <title>A Comprehensive Guide to TikTok API</title>
      <dc:creator>Scrapfly</dc:creator>
      <pubDate>Thu, 20 Mar 2025 22:54:18 +0000</pubDate>
      <link>https://dev.to/scrapfly_dev/a-comprehensive-guide-to-tiktok-api-49f6</link>
      <guid>https://dev.to/scrapfly_dev/a-comprehensive-guide-to-tiktok-api-49f6</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fguide-to-tiktok-api_banner_light.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fguide-to-tiktok-api_banner_light.svg" alt="A Comprehensive Guide to TikTok API" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.tiktok.com" rel="noopener noreferrer"&gt;TikTok&lt;/a&gt; has rapidly grown into one of the most popular social media platforms, attracting users and businesses alike. As the platform’s reach expands, so does the demand for data and insights.&lt;/p&gt;

&lt;p&gt;There are several official TikTok’s APIs which provide developers with tools to integrate TikTok functionalities into their applications and access TikTok data. This guide explores the available TikTok APIs, their use cases, and alternative methods for obtaining TikTok data.&lt;/p&gt;

&lt;p&gt;Legal Disclaimer and Precautions&lt;/p&gt;

&lt;p&gt;This tutorial covers popular web scraping techniques for education. Interacting with public servers requires diligence and respect and here's a good summary of what not to do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Do not scrape at rates that could damage the website.&lt;/li&gt;
&lt;li&gt;  Do not scrape data that's not available publicly.&lt;/li&gt;
&lt;li&gt;  Do not store PII of EU citizens who are protected by GDPR.&lt;/li&gt;
&lt;li&gt;  Do not repurpose the &lt;em&gt;entire&lt;/em&gt; public datasets which can be illegal in some countries.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Scrapfly does not offer legal advice but these are good general rules to follow in web scraping&lt;br&gt;&lt;br&gt;
and for more you should consult a lawyer.&lt;/p&gt;
&lt;h2&gt;
  
  
  What TikTok APIs Are Available?
&lt;/h2&gt;

&lt;p&gt;TikTok offers several APIs designed to serve different needs. Below, each API is explained in detail:&lt;/p&gt;
&lt;h3&gt;
  
  
  TikTok Login Kit
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://developers.tiktok.com/doc/login-kit-overview" rel="noopener noreferrer"&gt;TikTok Login Kit&lt;/a&gt; allows users to log in to third-party applications using their TikTok credentials. This API simplifies authentication and helps developers personalize user experiences by integrating TikTok accounts seamlessly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Enables TikTok-based authentication.&lt;/li&gt;
&lt;li&gt;  Access to basic user profile information.&lt;/li&gt;
&lt;li&gt;  Secure token-based login.&lt;/li&gt;
&lt;li&gt;  Customizable user consent flow.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
An e-commerce app uses the TikTok Login Kit to allow users to log in with their TikTok credentials. This streamlines registration and enables the app to offer personalized recommendations based on the user's TikTok activity.&lt;/p&gt;
&lt;h3&gt;
  
  
  TikTok Share Kit
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://developers.tiktok.com/doc/share-kit-ios-quickstart-v2" rel="noopener noreferrer"&gt;TikTok Share Kit&lt;/a&gt; enables users to share content from third-party apps directly to TikTok. It supports sharing videos, hashtags, captions, and more, making content creation and engagement more fluid.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Share video content directly to TikTok.&lt;/li&gt;
&lt;li&gt;  Pre-fill hashtags and captions.&lt;/li&gt;
&lt;li&gt;  Multi-platform compatibility (iOS, Android).&lt;/li&gt;
&lt;li&gt;  Real-time content preview.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A video editing app integrates the Share Kit to allow users to post their edited videos to TikTok with pre-filled trending hashtags and captions, increasing user engagement and app retention.&lt;/p&gt;
&lt;h3&gt;
  
  
  Content Posting API
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://developers.tiktok.com/doc/content-posting-api-get-started" rel="noopener noreferrer"&gt;The Content Posting API&lt;/a&gt; provides functionality for developers to automate the uploading of videos to TikTok. This API is particularly useful for businesses managing multiple accounts or scheduling content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Automate video uploads.&lt;/li&gt;
&lt;li&gt;  Schedule posts for optimal times.&lt;/li&gt;
&lt;li&gt;  Upload as drafts or publish directly.&lt;/li&gt;
&lt;li&gt;  Multi-account management.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A digital marketing agency uses the Content Posting API to manage TikTok campaigns for multiple clients, ensuring posts are published during peak engagement times.&lt;/p&gt;
&lt;h3&gt;
  
  
  Data Portability API
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://developers.tiktok.com/doc/data-portability-api-get-started" rel="noopener noreferrer"&gt;The Data Portability API&lt;/a&gt; facilitates the transfer of user data between TikTok and third-party applications, ensuring compliance with data privacy regulations and enhancing user control over their information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Secure data transfer for user requests.&lt;/li&gt;
&lt;li&gt;  GDPR compliance for European users.&lt;/li&gt;
&lt;li&gt;  Access to user activity history and account data.&lt;/li&gt;
&lt;li&gt;  Token-based authentication for secure interactions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A fitness app allows users to import their TikTok activity data through the Data Portability API to create customized workout challenges based on trending TikTok fitness trends.&lt;/p&gt;
&lt;h3&gt;
  
  
  Display API
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://developers.tiktok.com/doc/display-api-overview" rel="noopener noreferrer"&gt;The Display API&lt;/a&gt; allows developers to get basic TikTok profile info and content, such as videos and user feeds. This API is ideal for showcasing TikTok trends and enhancing content discoverability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Read a user's profile info (open id, avatar, display name, ...).&lt;/li&gt;
&lt;li&gt;  Read a user's public videos on TikTok.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A news website displays their trending TikTok videos on its homepage using the Display API, providing readers with engaging, real-time multimedia content.&lt;/p&gt;
&lt;h3&gt;
  
  
  Research API
&lt;/h3&gt;

&lt;p&gt;TikTok’s &lt;a href="https://developers.tiktok.com/doc/about-research-api" rel="noopener noreferrer"&gt;Research API&lt;/a&gt; is a specialized tool for academic and market research. It enables researchers to access anonymized and aggregated data for studying user behavior, trends, and platform dynamics.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Access anonymized user data.&lt;/li&gt;
&lt;li&gt;  Analyze hashtag performance and trends.&lt;/li&gt;
&lt;li&gt;  Retrieve aggregated data on specific topics.&lt;/li&gt;
&lt;li&gt;  Compliance with data privacy laws.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A university research team uses the Research API to study the impact of TikTok challenges on adolescent mental health, utilizing anonymized data to maintain privacy.&lt;/p&gt;
&lt;h3&gt;
  
  
  Commercial Content API
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://developers.tiktok.com/doc/commercial-content-api-getting-started" rel="noopener noreferrer"&gt;Commercial Content API&lt;/a&gt; is considered part for the research tools tiktok offer. It provides access to public advertiser data.&lt;/p&gt;

&lt;p&gt;For example, you can query the TikTok ads created in Italy between January 2, 2021 to January 9, 2021 with the keyword "coffee".&lt;/p&gt;
&lt;h3&gt;
  
  
  TikTok Business API
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://business-api.tiktok.com/portal" rel="noopener noreferrer"&gt;TikTok Business API&lt;/a&gt; is a robust tool for brands and advertisers. It allows businesses to create, manage, and optimize ad campaigns, providing comprehensive tools for audience targeting and analytics.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Campaign creation and management.&lt;/li&gt;
&lt;li&gt;  Audience segmentation and targeting.&lt;/li&gt;
&lt;li&gt;  Performance tracking and reporting.&lt;/li&gt;
&lt;li&gt;  Automated ad placement.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
An e-commerce retailer uses the TikTok Business API to launch a series of targeted ad campaigns, optimizing for conversions based on real-time performance data.&lt;/p&gt;

&lt;p&gt;However, this API is strictly geared towards business-related functionalities. It does not provide access to raw public tiktok data. For those needs, researchers often turn to the TikTok Research API.&lt;/p&gt;
&lt;h2&gt;
  
  
  TikTok API Alternative – Web Scraping
&lt;/h2&gt;

&lt;p&gt;For those unable to access TikTok’s official Research API, web scraping can serve as an alternative. This method involves extracting data directly from TikTok’s publicly accessible web pages using automated scripts. While effective, it comes with several caveats:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Legal Risks&lt;/strong&gt;: Scraping may violate TikTok’s terms of service and could result in legal consequences.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Technical Challenges&lt;/strong&gt;: TikTok employs anti-scraping mechanisms such as CAPTCHA and dynamic content loading, which require advanced techniques to bypass.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Ethical Considerations&lt;/strong&gt;: Respecting user privacy and adhering to ethical data collection practices is paramount.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At scrapfly, we are dedicated to provide developer withs all the resources they need to reach their scraping goals. Check out our &lt;a href="https://scrapfly.io/blog/how-to-scrape-tiktok-python-json/" rel="noopener noreferrer"&gt;comprehensive guide on scraping tiktok&lt;/a&gt; as well as our example &lt;a href="https://github.com/scrapfly/scrapfly-scrapers/tree/main/tiktok-scraper" rel="noopener noreferrer"&gt;tiktok scraper&lt;/a&gt; using Scrapfly's APIs on github.&lt;/p&gt;
&lt;h2&gt;
  
  
  Power Up Tiktok Scraping with Scrapfly
&lt;/h2&gt;

&lt;p&gt;Since TikTok employs anti-scraping mechanisms to prevent web-scrapers from accessing tiktok data, scraping tiktok with the traditional approaches cannot be done.&lt;/p&gt;

&lt;p&gt;ScrapFly provides &lt;a href="https://scrapfly.io/docs/scrape-api/getting-started" rel="noopener noreferrer"&gt;web scraping&lt;/a&gt;, &lt;a href="https://scrapfly.io/docs/screenshot-api/getting-started" rel="noopener noreferrer"&gt;screenshot&lt;/a&gt;, and &lt;a href="https://scrapfly.io/docs/extraction-api/getting-started" rel="noopener noreferrer"&gt;extraction&lt;/a&gt; APIs for data collection at scale.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://scrapfly.io/docs/scrape-api/anti-scraping-protection" rel="noopener noreferrer"&gt;Anti-bot protection bypass&lt;/a&gt; - scrape web pages without blocking!&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://scrapfly.io/docs/scrape-api/proxy" rel="noopener noreferrer"&gt;Rotating residential proxies&lt;/a&gt; - prevent IP address and geographic blocks.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://scrapfly.io/docs/scrape-api/javascript-rendering" rel="noopener noreferrer"&gt;JavaScript rendering&lt;/a&gt; - scrape dynamic web pages through cloud browsers.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://scrapfly.io/docs/scrape-api/javascript-scenario" rel="noopener noreferrer"&gt;Full browser automation&lt;/a&gt; - control browsers to scroll, input and click on objects.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://scrapfly.io/docs/scrape-api/getting-started#api_param_format" rel="noopener noreferrer"&gt;Format conversion&lt;/a&gt; - scrape as HTML, JSON, Text, or Markdown.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://scrapfly.io/docs/sdk/python" rel="noopener noreferrer"&gt;Python&lt;/a&gt; and &lt;a href="https://scrapfly.io/docs/sdk/typescript" rel="noopener noreferrer"&gt;Typescript&lt;/a&gt; SDKs, as well as &lt;a href="https://scrapfly.io/docs/sdk/scrapy" rel="noopener noreferrer"&gt;Scrapy&lt;/a&gt; and &lt;a href="https://scrapfly.io/docs/integration/getting-started" rel="noopener noreferrer"&gt;no-code tool integrations&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is simple python code the uses Scrapfly's python SDK to scrape tiktok posts and parse them into JSON data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;jmespath&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;typing&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Dict&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;urllib.parse&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;urlencode&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;urlparse&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;parse_qs&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;loguru&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;logger&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;scrapfly&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ScrapeConfig&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ScrapflyClient&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ScrapeApiResponse&lt;/span&gt;

&lt;span class="n"&gt;SCRAPFLY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;ScrapflyClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;YOUR_SCRAPFLY_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;BASE_CONFIG&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;# bypass tiktok.com web scraping blocking
&lt;/span&gt;    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;asp&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="c1"&gt;# set the proxy country to US
&lt;/span&gt;    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;country&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;US&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;parse_post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ScrapeApiResponse&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Dict&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;parse hidden post data from HTML&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;selector&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;selector&lt;/span&gt;
    &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;xpath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;//script[@id=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__UNIVERSAL_DATA_FOR_REHYDRATION__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;]/text()&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;post_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__DEFAULT_SCOPE__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;webapp.video-detail&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;itemInfo&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;itemStruct&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;parsed_post_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;jmespath&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;{
        id: id,
        desc: desc,
        createTime: createTime,
        video: video.{duration: duration, ratio: ratio, cover: cover, playAddr: playAddr, downloadAddr: downloadAddr, bitrate: bitrate},
        author: author.{id: id, uniqueId: uniqueId, nickname: nickname, avatarLarger: avatarLarger, signature: signature, verified: verified},
        stats: stats,
        locationCreated: locationCreated,
        diversificationLabels: diversificationLabels,
        suggestedWords: suggestedWords,
        contents: contents[].{textExtra: textExtra[].{hashtagName: hashtagName}}
        }&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;post_data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;parsed_post_data&lt;/span&gt;


&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;scrape_posts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;urls&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Dict&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;scrape tiktok posts data from their URLs&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;to_scrape&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;ScrapeConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;BASE_CONFIG&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;urls&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;SCRAPFLY&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;concurrent_scrape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;to_scrape&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;post_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;parse_post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;post_data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;success&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;scraped &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; posts from post pages&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;To wrap up our intro to official Tiktok API here are some frequently asked questions that we might have not covered in the article:&lt;/p&gt;

&lt;h4&gt;
  
  
  Can I access TikTok’s Research API as an individual?
&lt;/h4&gt;

&lt;p&gt;Typically, no. Access is restricted to accredited researchers or organizations that meet specific criteria.&lt;/p&gt;

&lt;h4&gt;
  
  
  What are the requirements to access the TikTok APIs?
&lt;/h4&gt;

&lt;p&gt;Accessing TikTok APIs typically requires developers to create an account on the TikTok Developers Portal and register their application. Some APIs, like the Research API, require additional approval, which includes meeting criteria such as being an accredited researcher or organization, demonstrating a legitimate purpose, and adhering to privacy guidelines.&lt;/p&gt;

&lt;h4&gt;
  
  
  Can I use the APIs to fetch public TikTok data?
&lt;/h4&gt;

&lt;p&gt;Most TikTok APIs, such as the Business API and Research API, are not designed to provide raw public data. Access to public data via the Research API is limited to approved researchers and comes with strict data privacy and usage guidelines. Developers looking for public data may consider alternatives like web scraping.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;TikTok’s APIs offer a range of tools for developers, businesses, and researchers, but access and functionality are often limited by stringent requirements. For those looking to extract large-scale data, the Research API is the most suitable option but comes with access restrictions.&lt;/p&gt;

&lt;p&gt;Web scraping remains an alternative, albeit with significant risks and limitations. Understanding these tools and their boundaries is essential for making informed decisions about TikTok data integration and analysis.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>GPT Crawler: The AI Training Data Collection Guide</title>
      <dc:creator>Scrapfly</dc:creator>
      <pubDate>Thu, 20 Mar 2025 22:41:47 +0000</pubDate>
      <link>https://dev.to/scrapfly_dev/gpt-crawler-the-ai-training-data-collection-guide-3j77</link>
      <guid>https://dev.to/scrapfly_dev/gpt-crawler-the-ai-training-data-collection-guide-3j77</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2F2025%2F03%2Fgpt-crawler-white-bg-1.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2F2025%2F03%2Fgpt-crawler-white-bg-1.svg" alt="GPT Crawler: The AI Training Data Collection Guide" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;!--kg-card-begin: markdown--&amp;gt; &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2F2025%2F03%2Fgpt-crawler-blue-bg.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2F2025%2F03%2Fgpt-crawler-blue-bg.svg" alt="GPT Crawler: The AI Training Data Collection Guide" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GPT Crawler is a powerful, specialized tool designed to automate web data collection specifically for training large language models (LLMs) like ChatGPT. In today's AI development landscape, high-quality training data is essential, but obtaining it can be challenging and time-consuming.&lt;/p&gt;

&lt;p&gt;This guide provides a comprehensive walkthrough of GPT Crawler's capabilities, showing AI developers and researchers how to efficiently gather diverse, contextually-rich web content to enhance their language models' performance.&lt;/p&gt;

&lt;p&gt;&amp;lt;!--kg-card-end: markdown--&amp;gt;&amp;lt;!--kg-card-begin: markdown--&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is GPT Crawler?
&lt;/h2&gt;

&lt;p&gt;GPT Crawler distinguishes itself from traditional web scraping tools by focusing specifically on AI training data collection. Unlike general-purpose scrapers, GPT Crawler was built from the ground up with machine learning requirements in mind.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Features of GPT Crawler
&lt;/h2&gt;

&lt;p&gt;GPT Crawler has gained popularity among AI developers due to its powerful capabilities that streamline the data collection process.&lt;/p&gt;

&lt;h3&gt;
  
  
  Intelligent Content Extraction
&lt;/h3&gt;

&lt;p&gt;Intelligent content extraction is a core feature of GPT Crawler, enabling it to extract relevant text and metadata from web pages effectively. Key capabilities include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Semantic parsing&lt;/strong&gt; that understands document structure&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content quality assessment&lt;/strong&gt; to filter low-value text&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Metadata preservation&lt;/strong&gt; for better context understanding&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-format support&lt;/strong&gt; including HTML, JavaScript-rendered content, and PDFs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, let's look at how GPT Crawler handles content extraction in practice.&lt;/p&gt;

&lt;h3&gt;
  
  
  Scalability and Performance
&lt;/h3&gt;

&lt;p&gt;GPT Crawler is designed to handle large-scale data collection tasks efficiently. It offers features that ensure optimal performance and scalability, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Distributed crawling architecture&lt;/strong&gt; for handling large-scale data collection&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rate limiting and politeness controls&lt;/strong&gt; to respect website resources&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Checkpoint and resume capabilities&lt;/strong&gt; for long-running crawl jobs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resource-efficient operation&lt;/strong&gt; even on modest hardware&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's look at how these features translate to practical implementation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up GPT Crawler
&lt;/h2&gt;

&lt;p&gt;Getting started with GPT Crawler requires some basic setup. Here's a straightforward process to begin collecting web data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;To install GPT Crawler, you will need to clone the repository and install the necessary dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git clone https://github.com/builderio/gpt-crawler
$ cd gpt-crawler
$ npm install

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will set up the project and install the required packages. Next, you'll need to configure the crawler for your specific data collection needs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Basic Configuration
&lt;/h3&gt;

&lt;p&gt;Creating a crawl configuration file is essential for defining what and how you'll crawl:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# config.ts
import { Config } from "./src/config";

export const defaultConfig: Config = {
  url: "https://web-scraping.dev/products",
  match: "https://web-scraping.dev/product/**",
  maxPagesToCrawl: 10,
  outputFileName: "output.json",
  maxTokens: 2000000,
};

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the &lt;code&gt;config.ts&lt;/code&gt; file, you can define the starting URL, URL patterns to match, the maximum number of pages to crawl, the output file name, and other settings. The &lt;code&gt;url&lt;/code&gt; is the starting point of the crawl, and the &lt;code&gt;match&lt;/code&gt; is a pattern to match URLs to crawl. The &lt;code&gt;maxPagesToCrawl&lt;/code&gt; sets the limit on the number of pages to crawl, and the &lt;code&gt;outputFileName&lt;/code&gt; specifies the name of the output file where the extracted data will be saved.&lt;/p&gt;

&lt;h3&gt;
  
  
  Running Your First Crawl
&lt;/h3&gt;

&lt;p&gt;With the configuration set up, you can start crawling with just one command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm run start

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Example output of the crawler run
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
INFO PlaywrightCrawler: Starting the crawler.
INFO PlaywrightCrawler: Crawling: Page 1 / 10 - URL: https://web-scraping.dev/products...
INFO PlaywrightCrawler: Crawling: Page 2 / 10 - URL: https://web-scraping.dev/product/1...
...
INFO PlaywrightCrawler: Crawling: Page 9 / 10 - URL: https://web-scraping.dev/product/1?variant=orange-large...
INFO PlaywrightCrawler: Crawling: Page 10 / 10 - URL: https://web-scraping.dev/product/1?variant=cherry-small...
INFO PlaywrightCrawler: Crawler reached the maxRequestsPerCrawl limit of 10 requests and will shut down soon. Requests that are in progress will be allowed to finish.
INFO PlaywrightCrawler: Crawling: Page 11 / 10 - URL: https://web-scraping.dev/product/1?variant=cherry-medium...
INFO PlaywrightCrawler: Earlier, the crawler reached the maxRequestsPerCrawl limit of 10 requests and all requests that were in progress at that time have now finished. In total, the crawler processed 11 requests and will shut down.
Found 11 files to combine...
Wrote 11 items to output-1.json

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will start the crawler, and you'll see the progress as it extracts content from the specified URLs. Once the crawl is complete, the extracted data will be saved to the output file you specified in the configuration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Run with CLI Only
&lt;/h3&gt;

&lt;p&gt;You can also run the crawler with CLI only without the need for a configuration file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm run start -- --url https://web-scraping.dev/products --match https://web-scraping.dev/product/** --maxPagesToCrawl 10 --outputFileName output.json --maxTokens 2000000

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will start the crawler with the specified parameters directly from the command line. It's a convenient way to run the crawler without needing to create a configuration file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common Challenges and Solutions
&lt;/h2&gt;

&lt;p&gt;When working with GPT Crawler, you may encounter several challenges. Here are practical solutions to the most common issues:&lt;/p&gt;

&lt;h3&gt;
  
  
  Rate Limiting and Blocking
&lt;/h3&gt;

&lt;p&gt;Websites often implement rate limiting and may block IP addresses that send too many requests. To avoid this, consider the following strategies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Implement adaptive rate limiting&lt;/strong&gt; that responds to server response times&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rotate user agents&lt;/strong&gt; to appear less like an automated system&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use proxy rotation&lt;/strong&gt; for large-scale crawling projects&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add random delays&lt;/strong&gt; between requests to mimic human browsing patterns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By implementing these strategies, you can reduce the risk of being rate-limited or blocked while crawling websites.&lt;/p&gt;

&lt;h3&gt;
  
  
  Content Quality Control
&lt;/h3&gt;

&lt;p&gt;Some web pages contain low-quality or irrelevant content that can negatively impact your training data. To address this, consider the following approaches:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Filter by content length&lt;/strong&gt; to avoid short, low-value pages&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Implement language detection&lt;/strong&gt; to focus on content in specific languages&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use keyword relevance scoring&lt;/strong&gt; to prioritize topical content&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Detect and skip duplicate or near-duplicate content&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Following these strategies will help you maintain a high-quality dataset for your AI training needs.&lt;/p&gt;

&lt;h4&gt;
  
  
  Cleaning Extracted Data
&lt;/h4&gt;

&lt;p&gt;Extracted data may contain unwanted elements like ads, navigation links, or boilerplate text. To clean the data effectively:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import re

def clean_text(text):
    # Remove URLs
    text = re.sub(r'http\S+', '', text)
    # Remove non-alphanumeric characters
    text = re.sub(r'[^a-zA-Z0-9\s]', '', text)
    # Remove extra whitespace
    text = re.sub(r'\s+', ' ', text)
    # Add more cleaning operations as needed

    return text

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This Python function uses regular expressions to clean the extracted text by removing URLs, non-alphanumeric characters, and extra whitespace. You can customize this function further based on your specific data cleaning requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preparing Crawled Data for AI Training
&lt;/h2&gt;

&lt;p&gt;Once you've collected your data, proper formatting is crucial for effective AI training:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Clean and normalize text&lt;/strong&gt; to remove inconsistencies&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Apply tokenization&lt;/strong&gt; compatible with your target LLM&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Structure the data&lt;/strong&gt; in the format required by your training pipeline&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create train/validation splits&lt;/strong&gt; for proper model evaluation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's a simple example of preparing the collected data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import json
import random
from sklearn.model_selection import train_test_split

# Load the crawled data
with open("training_data.jsonl", "r") as f:
    data = [json.loads(line) for line in f]

# Basic text cleaning
cleaned_data = []
for item in data:
    text = item["content"]
    # Remove excessive whitespace
    text = " ".join(text.split())
    # Other cleaning operations...

    cleaned_data.append({
        "text": text,
        "metadata": item["metadata"]
    })

# Create train/validation split
train_data, val_data = train_test_split(cleaned_data, test_size=0.1, random_state=42)

# Save in a format suitable for LLM training
with open("train_data.jsonl", "w") as f:
    for item in train_data:
        f.write(json.dumps(item) + "\n")

with open("val_data.jsonl", "w") as f:
    for item in val_data:
        f.write(json.dumps(item) + "\n")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above Python script, we load the crawled data, clean the text content, and create a train/validation split. Finally, we save the cleaned data in a format suitable for training an LLM.&lt;/p&gt;

&lt;p&gt;If you want a comprehensive guide on what is the difference between &lt;code&gt;json&lt;/code&gt; and &lt;code&gt;jsonl&lt;/code&gt; file formats, you can check out our article:&lt;/p&gt;

&lt;p&gt;[&lt;/p&gt;

&lt;p&gt;JSONL vs JSON&lt;/p&gt;

&lt;p&gt;Learn the differences between JSON and JSONLines, their use cases, and efficiency. Why JSONLines excels in web scraping and real-time processing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fjsonl-vs-json_banner_light.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fjsonl-vs-json_banner_light.svg" alt="GPT Crawler: The AI Training Data Collection Guide" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
](&lt;a href="https://scrapfly.io/blog/jsonl-vs-json/" rel="noopener noreferrer"&gt;https://scrapfly.io/blog/jsonl-vs-json/&lt;/a&gt;)&lt;/p&gt;

&lt;h2&gt;
  
  
  GPT Crawler vs. Alternative Tools
&lt;/h2&gt;

&lt;p&gt;GPT Crawler offers unique advantages for AI training data collection, but it's essential to consider how it compares to alternative tools. Here's a comparison of GPT Crawler with other popular web scraping and data collection tools:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;GPT Crawler&lt;/th&gt;
&lt;th&gt;Scrapy&lt;/th&gt;
&lt;th&gt;Beautiful Soup&lt;/th&gt;
&lt;th&gt;Playwright&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Focus&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;AI training data&lt;/td&gt;
&lt;td&gt;General web scraping&lt;/td&gt;
&lt;td&gt;HTML parsing&lt;/td&gt;
&lt;td&gt;Browser automation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;JavaScript Support&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Built-in&lt;/td&gt;
&lt;td&gt;Requires add-ons&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Built-in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Ease of Setup&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;Complex&lt;/td&gt;
&lt;td&gt;Simple&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Content Quality Filtering&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Advanced&lt;/td&gt;
&lt;td&gt;Manual&lt;/td&gt;
&lt;td&gt;Manual&lt;/td&gt;
&lt;td&gt;Manual&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Token Counting&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Built-in&lt;/td&gt;
&lt;td&gt;Not available&lt;/td&gt;
&lt;td&gt;Not available&lt;/td&gt;
&lt;td&gt;Not available&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Scalability&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;Very high&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Learning Curve&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;Steep&lt;/td&gt;
&lt;td&gt;Gentle&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;GPT Crawler's focus on AI training data collection, built-in JavaScript support, and content quality filtering set it apart from other tools. While &lt;a href="https://scrapfly.io/blog/web-scraping-with-scrapy/" rel="noopener noreferrer"&gt;Scrapy&lt;/a&gt; and &lt;a href="https://scrapfly.io/blog/web-scraping-with-python-beautifulsoup/" rel="noopener noreferrer"&gt;Beautiful Soup&lt;/a&gt; are more general-purpose web scraping tools, &lt;a href="https://scrapfly.io/blog/web-scraping-with-playwright-and-python/" rel="noopener noreferrer"&gt;Playwright&lt;/a&gt; offers browser automation capabilities similar to GPT Crawler.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;Now, let's address some common questions about GPT Crawler:&lt;/p&gt;

&lt;h3&gt;
  
  
  Is GPT Crawler open source?
&lt;/h3&gt;

&lt;p&gt;Yes, GPT Crawler is available as an open-source project under the MIT license. This allows developers to freely use, modify, and contribute to the codebase while building their own specialized data collection solutions.&lt;/p&gt;

&lt;h3&gt;
  
  
  How does GPT Crawler compare to Scrapy?
&lt;/h3&gt;

&lt;p&gt;GPT Crawler is specifically optimized for AI training data collection with built-in semantic processing and quality filtering, while Scrapy is a more general-purpose web scraping framework. GPT Crawler requires less configuration for AI-specific tasks but has fewer customization options than Scrapy.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can GPT Crawler handle content behind login pages?
&lt;/h3&gt;

&lt;p&gt;Yes, GPT Crawler supports authenticated crawling through its browser automation features. You can configure login credentials and actions in the browser settings to access content that requires authentication before collection begins.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;GPT Crawler represents a significant advancement in specialized data collection for AI training. By focusing on high-quality, contextually-relevant content extraction, it addresses many of the challenges faced by AI researchers and developers in gathering suitable training data.&lt;/p&gt;

&lt;p&gt;Whether you're building a domain-specific model or enhancing an existing LLM with specialized knowledge, GPT Crawler provides the tools needed to efficiently collect and process web data for AI training purposes.&lt;/p&gt;

&lt;p&gt;As the field of AI continues to evolve, tools like GPT Crawler will play an increasingly important role in helping developers access the high-quality data needed to train the next generation of language models.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webcrawling</category>
    </item>
    <item>
      <title>How to Choose the Best Proxy Unblocker?</title>
      <dc:creator>Scrapfly</dc:creator>
      <pubDate>Fri, 14 Mar 2025 23:01:58 +0000</pubDate>
      <link>https://dev.to/scrapfly_dev/how-to-choose-the-best-proxy-unblocker-3b7j</link>
      <guid>https://dev.to/scrapfly_dev/how-to-choose-the-best-proxy-unblocker-3b7j</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2F2025%2F03%2Fproxy-unblocker-white-bg.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2F2025%2F03%2Fproxy-unblocker-white-bg.webp" alt="How to Choose the Best Proxy Unblocker?" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;!--kg-card-begin: markdown--&amp;gt; &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2F2025%2F03%2Fproxy-unblocker-blue-bg.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2F2025%2F03%2Fproxy-unblocker-blue-bg.webp" alt="How to Choose the Best Proxy Unblocker?" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The internet is full of restrictions, from workplace firewalls to geo-blocked websites. If you've seen &lt;em&gt;"You seem to be using an unblocker or proxy"&lt;/em&gt;, you know the frustration. Luckily, proxy unblockers help bypass these barriers with ease.&lt;/p&gt;

&lt;p&gt;In this guide, we’ll break down everything you need to know about proxies, including how they change your IP, why websites block access, and how you can save bandwidth with a proxy saver.&lt;/p&gt;

&lt;p&gt;&amp;lt;!--kg-card-end: markdown--&amp;gt;&amp;lt;!--kg-card-begin: markdown--&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Proxy Unblocker?
&lt;/h2&gt;

&lt;p&gt;A proxy unblocker is a tool that allows users to bypass website restrictions by routing their internet traffic through a different IP address. Proxies act as intermediaries between your device and the website you’re trying to access. Instead of connecting directly to a site, your request goes through a proxy server, which then fetches the content on your behalf.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is a Proxy?
&lt;/h3&gt;

&lt;p&gt;At its core, a proxy is any server that acts as a gateway between your device and the internet. There are different types of proxies, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HTTP Proxy:&lt;/strong&gt; A protocol designed for web traffic, handling only HTTP/HTTPS requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UDP Proxies:&lt;/strong&gt; Designed for connectionless traffic, often used for gaming, VoIP, and real-time streaming applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Residential Proxies:&lt;/strong&gt; These use IP addresses assigned by ISPs to real homes. They are harder to detect because they mimic genuine user traffic.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a detailed explanation, check out our blog:&lt;/p&gt;

&lt;p&gt;[&lt;/p&gt;

&lt;p&gt;The Complete Guide To Using Proxies For Web Scraping&lt;/p&gt;

&lt;p&gt;Introduction to proxy usage in web scraping. What types of proxies are there? How to evaluate proxy providers and avoid common issues.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fintroduction-to-proxies-in-web-scraping_banner_light.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fintroduction-to-proxies-in-web-scraping_banner_light.svg" alt="How to Choose the Best Proxy Unblocker?" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
](&lt;a href="https://scrapfly.io/blog/introduction-to-proxies-in-web-scraping/" rel="noopener noreferrer"&gt;https://scrapfly.io/blog/introduction-to-proxies-in-web-scraping/&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Now that we understand proxies, let's explore how they actually change your IP address and help you unblock sites.&lt;/p&gt;
&lt;h2&gt;
  
  
  How Proxies Change IP
&lt;/h2&gt;

&lt;p&gt;Websites track and identify users through their &lt;strong&gt;IP addresses&lt;/strong&gt;. If a website blocks an IP, that device can no longer access the site. A proxy works by replacing your real IP address with a new one, making it appear as if your request is coming from a different location.&lt;/p&gt;
&lt;h3&gt;
  
  
  Example: Changing IP with a Proxy
&lt;/h3&gt;

&lt;p&gt;Here’s a simple Python example using &lt;a href="https://pypi.org/project/requests/" rel="noopener noreferrer"&gt;requests&lt;/a&gt; and a proxy to access a blocked site:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests

# Define the proxy
proxies = {
    "http": "http://your-proxy-ip:port",
    "https": "https://your-proxy-ip:port"
}

# Make a request through the proxy
response = requests.get("https://web-scraping.dev/", proxies=proxies)

# Print the response
print(response.text)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above code, we use a proxy server to fetch the webpage instead of directly connecting. If the website had blocked our real IP, this method would help us regain access.&lt;/p&gt;

&lt;p&gt;Now that we know how proxies change IPs, let's talk about their costs and efficiency.&lt;/p&gt;

&lt;h2&gt;
  
  
  Proxy Costs
&lt;/h2&gt;

&lt;p&gt;Using a proxy service isn’t always free. While free proxy unblockers exist, they come with risks such as slow speeds, data logging, or unreliable connections. On the other hand, premium proxies offer stability and security but at a cost.&lt;/p&gt;

&lt;h3&gt;
  
  
  Free vs. Paid Proxies
&lt;/h3&gt;

&lt;p&gt;Free proxies may be tempting, but they often come with slow speeds, security risks, and limits. Paid proxies offer better performance, security, and reliability. Here's a quick comparison:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Free Proxy&lt;/th&gt;
&lt;th&gt;Paid Proxy&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Speed&lt;/td&gt;
&lt;td&gt;Slow&lt;/td&gt;
&lt;td&gt;Fast &amp;amp; Reliable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Security&lt;/td&gt;
&lt;td&gt;Risky (may log data)&lt;/td&gt;
&lt;td&gt;High (no logging)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IP Rotation&lt;/td&gt;
&lt;td&gt;Limited&lt;/td&gt;
&lt;td&gt;Frequent changes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Usage Limits&lt;/td&gt;
&lt;td&gt;Often restricted&lt;/td&gt;
&lt;td&gt;Unlimited&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If cost is a concern, proxy savers can help reduce expenses by optimizing bandwidth.&lt;/p&gt;

&lt;h2&gt;
  
  
  Save Proxy Bandwidth with Proxy Saver
&lt;/h2&gt;

&lt;p&gt;A proxy saver helps you optimize proxy usage, reducing data consumption and costs. Many users burn through proxies too quickly, leading to unnecessary expenses. By implementing a few smart techniques, you can extend the life of your proxies and improve efficiency.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Reduce Proxy Bandwidth Usage
&lt;/h3&gt;

&lt;p&gt;Efficient proxy usage helps reduce costs and improve performance. Here are some effective ways to save bandwidth:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cache Responses:&lt;/strong&gt; Store frequently accessed pages locally to reduce proxy requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use Compression:&lt;/strong&gt; Enable gzip compression to shrink data size and speed up loading.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optimize Requests:&lt;/strong&gt; Fetch only necessary elements (e.g., text or API data) instead of full pages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using these strategies helps maximize proxy efficiency. Now, let’s explore why websites block users.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Causes Blocking?
&lt;/h2&gt;

&lt;p&gt;Websites block users for various reasons, often to enforce security, prevent abuse, or comply with regional restrictions. Understanding these blocking methods can help you choose the best way to bypass them.&lt;/p&gt;

&lt;h3&gt;
  
  
  IP-Based Blocking
&lt;/h3&gt;

&lt;p&gt;Websites track users by their &lt;strong&gt;IP addresses&lt;/strong&gt;. If too many requests come from the same IP, the site may flag it as suspicious and block access. This often happens with shared proxies or when trying to visit &lt;strong&gt;unblocked websites&lt;/strong&gt; from restricted locations.&lt;/p&gt;

&lt;h3&gt;
  
  
  User-Agent Blocking
&lt;/h3&gt;

&lt;p&gt;Some sites restrict access based on &lt;strong&gt;browser user-agent data&lt;/strong&gt; , which identifies the browser and device you’re using. Automated scripts or outdated user-agents can trigger blocks, preventing access to certain websites.&lt;/p&gt;

&lt;h3&gt;
  
  
  Geo-Restrictions
&lt;/h3&gt;

&lt;p&gt;Streaming services, news sites, and other platforms often block content based on &lt;strong&gt;geolocation&lt;/strong&gt;. If a website isn’t available in your country, using a &lt;strong&gt;residential proxy&lt;/strong&gt; or &lt;strong&gt;VPN&lt;/strong&gt; can help bypass these restrictions.&lt;/p&gt;

&lt;p&gt;Here’s a table summarizing the main causes of website blocking and possible solutions:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Blocking Method&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;How It Works&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;IP-Based Blocking&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Too many requests from the same IP trigger a block.&lt;/td&gt;
&lt;td&gt;Use &lt;strong&gt;rotating or residential proxies&lt;/strong&gt; to change IPs.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;User-Agent Blocking&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Sites restrict access based on browser/device data.&lt;/td&gt;
&lt;td&gt;Use &lt;strong&gt;updated user-agents&lt;/strong&gt; or &lt;strong&gt;browser emulation.&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Geo-Restrictions&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Content is blocked based on location.&lt;/td&gt;
&lt;td&gt;Use a &lt;strong&gt;VPN&lt;/strong&gt; or &lt;strong&gt;residential proxy&lt;/strong&gt; to bypass restrictions.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Understanding these blocking methods helps you choose the best way to regain access. Now, let’s explore other ways to unblock websites.&lt;/p&gt;

&lt;h2&gt;
  
  
  Other Ways to Unblock Websites
&lt;/h2&gt;

&lt;p&gt;While proxies are effective tools for bypassing website restrictions, several alternative methods offer unique advantages depending on your specific needs. Here's a comprehensive overview of other powerful unblocking techniques:&lt;/p&gt;

&lt;h3&gt;
  
  
  VPNs – Complete Network Protection
&lt;/h3&gt;

&lt;p&gt;Virtual Private Networks provide a more comprehensive solution than standard proxies by encrypting your entire internet connection. Unlike proxies that only redirect specific web requests, VPNs route all your device's traffic through an encrypted tunnel.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;End-to-end encryption protects all internet traffic&lt;/li&gt;
&lt;li&gt;Device-level protection covers all applications&lt;/li&gt;
&lt;li&gt;Stronger security protocols (OpenVPN, WireGuard, IKEv2)&lt;/li&gt;
&lt;li&gt;Kill switch features prevent data leaks if connection drops&lt;/li&gt;
&lt;li&gt;No-logs policies with premium providers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;VPNs are ideal for privacy-conscious users, accessing geo-restricted streaming services, and protecting sensitive communications on public networks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Smart DNS Services – Optimized for Streaming
&lt;/h3&gt;

&lt;p&gt;Smart DNS solutions specifically target geo-restrictions while maintaining full connection speeds:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No encryption overhead results in faster connections than VPNs&lt;/li&gt;
&lt;li&gt;Selective routing only redirects DNS queries for geo-blocked sites&lt;/li&gt;
&lt;li&gt;Wide device compatibility including smart TVs and gaming consoles&lt;/li&gt;
&lt;li&gt;Easier configuration with no software installation on many platforms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These services work particularly well for streaming enthusiasts who prioritize speed and device compatibility over comprehensive privacy.&lt;/p&gt;

&lt;h3&gt;
  
  
  Browser Extensions – Lightweight Solutions
&lt;/h3&gt;

&lt;p&gt;Modern browser extensions offer convenient and targeted unblocking capabilities:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One-click activation for immediate access to blocked content&lt;/li&gt;
&lt;li&gt;Selective protection lets you choose which sites use the proxy&lt;/li&gt;
&lt;li&gt;Resource efficiency with minimal performance impact&lt;/li&gt;
&lt;li&gt;Additional privacy features like tracker blocking and cookie management&lt;/li&gt;
&lt;li&gt;WebRTC leak protection prevents accidental IP exposure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Extensions work best for casual users who need occasional access to blocked websites without complex setup procedures.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advanced DNS Techniques
&lt;/h3&gt;

&lt;p&gt;DNS-based solutions provide a simple yet effective approach to bypassing certain restrictions:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Public DNS servers (Google 8.8.8.8, Cloudflare 1.1.1.1) bypass ISP DNS blocks&lt;/li&gt;
&lt;li&gt;DNS-over-HTTPS (DoH) and DNS-over-TLS (DoT) encrypt DNS requests&lt;/li&gt;
&lt;li&gt;Network-wide protection with solutions like Pi-hole&lt;/li&gt;
&lt;li&gt;Can overcome basic censorship with minimal configuration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These techniques are perfect for bypassing basic ISP-level blocking with minimal performance impact.&lt;/p&gt;

&lt;h3&gt;
  
  
  SSH Tunneling – Technical but Powerful
&lt;/h3&gt;

&lt;p&gt;For tech-savvy users, SSH tunneling offers high security with low visibility:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creates SOCKS proxies through encrypted SSH connections&lt;/li&gt;
&lt;li&gt;Enables port forwarding for specific applications&lt;/li&gt;
&lt;li&gt;Lower detection risk compared to commercial VPN services&lt;/li&gt;
&lt;li&gt;Highly customizable for specific technical requirements&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;SSH tunneling is best suited for technical users requiring secure access to specific services or applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tor Network – Maximum Anonymity
&lt;/h3&gt;

&lt;p&gt;The Tor network provides the highest level of anonymity through multi-layered routing:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Onion routing sends traffic through multiple encrypted relay points&lt;/li&gt;
&lt;li&gt;Global relay network makes tracking extremely difficult&lt;/li&gt;
&lt;li&gt;Provides access to .onion sites not available on the regular internet&lt;/li&gt;
&lt;li&gt;Built-in protection against various tracking techniques&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a detailed explanation, check out our blog:&lt;/p&gt;

&lt;p&gt;[&lt;/p&gt;

&lt;p&gt;How to Use Tor For Web Scraping&lt;/p&gt;

&lt;p&gt;Learn about web scraping using Tor as a proxy and rotating proxy server by randomly changing the IP address with HTTP or SOCKS.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fintroduction-to-proxies-in-web-scraping_banner_light.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fintroduction-to-proxies-in-web-scraping_banner_light.svg" alt="How to Choose the Best Proxy Unblocker?" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
](&lt;a href="https://scrapfly.io/blog/how-to-use-tor-for-web-scraping//" rel="noopener noreferrer"&gt;https://scrapfly.io/blog/how-to-use-tor-for-web-scraping//&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Tor is especially valuable for users requiring maximum anonymity or accessing content in heavily censored regions.&lt;/p&gt;
&lt;h3&gt;
  
  
  Mobile-Specific Solutions
&lt;/h3&gt;

&lt;p&gt;Mobile devices have unique options for bypassing restrictions:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using mobile data instead of WiFi can bypass local network restrictions&lt;/li&gt;
&lt;li&gt;eSIM services provide remote cellular connections from different countries&lt;/li&gt;
&lt;li&gt;Operator-specific apps may include free access to certain content&lt;/li&gt;
&lt;li&gt;Tethering through alternative connections can bypass device-specific limits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These approaches are particularly helpful for mobile users dealing with WiFi restrictions or needing country-specific access.&lt;/p&gt;

&lt;p&gt;While these methods work for general browsing, web scraping often requires more advanced solutions. Let’s explore how Scrapfly can help.&lt;/p&gt;
&lt;h2&gt;
  
  
  Unblock Scraping with Scrapfly
&lt;/h2&gt;

&lt;p&gt;Bypassing anti-bot systems while possible is often very difficult - let Scrapfly do it for you!&lt;/p&gt;

&lt;p&gt;ScrapFly provides &lt;a href="https://scrapfly.io/docs/scrape-api/getting-started" rel="noopener noreferrer"&gt;web scraping&lt;/a&gt;, &lt;a href="https://scrapfly.io/docs/screenshot-api/getting-started" rel="noopener noreferrer"&gt;screenshot&lt;/a&gt;, and &lt;a href="https://scrapfly.io/docs/extraction-api/getting-started" rel="noopener noreferrer"&gt;extraction&lt;/a&gt; APIs for data collection at scale.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/anti-scraping-protection" rel="noopener noreferrer"&gt;Anti-bot protection bypass&lt;/a&gt; - scrape web pages without blocking!&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/proxy" rel="noopener noreferrer"&gt;Rotating residential proxies&lt;/a&gt; - prevent IP address and geographic blocks.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/javascript-rendering" rel="noopener noreferrer"&gt;JavaScript rendering&lt;/a&gt; - scrape dynamic web pages through cloud browsers.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/javascript-scenario" rel="noopener noreferrer"&gt;Full browser automation&lt;/a&gt; - control browsers to scroll, input and click on objects.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/getting-started#api_param_format" rel="noopener noreferrer"&gt;Format conversion&lt;/a&gt; - scrape as HTML, JSON, Text, or Markdown.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/sdk/python" rel="noopener noreferrer"&gt;Python&lt;/a&gt; and &lt;a href="https://scrapfly.io/docs/sdk/typescript" rel="noopener noreferrer"&gt;Typescript&lt;/a&gt; SDKs, as well as &lt;a href="https://scrapfly.io/docs/sdk/scrapy" rel="noopener noreferrer"&gt;Scrapy&lt;/a&gt; and &lt;a href="https://scrapfly.io/docs/integration/getting-started" rel="noopener noreferrer"&gt;no-code tool integrations&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fcommon_scrapfly-api.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fcommon_scrapfly-api.svg" alt="How to Choose the Best Proxy Unblocker?" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's how we can scrape data without being blocked using ScrapFly. All we have to do is enable the &lt;code&gt;asp&lt;/code&gt; parameter, select the proxy pool (datacenter or residential), and proxy country:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from scrapfly import ScrapflyClient, ScrapeConfig, ScrapeApiResponse

scrapfly = ScrapflyClient(key="Your ScrapFly API key")

response: ScrapeApiResponse = scrapfly.scrape(ScrapeConfig(
   url="the target website URL",
   # select a proxy pool
   proxy_pool="public_residential_pool",
   # select a the proxy country
   country="us",
   # enable the ASP to bypass any website's blocking
   asp=True,
   # enable JS rendering, similar to headless browsers
   render_js=True,
))

# get the page HTML content
print(response.scrape_result['content'])
# use the built-in parsel selector
selector = response.selector

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;To wrap this introduction up let's take a look at some frequently asked questions regarding Cloudscraper.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is the difference between a VPN and a proxy?
&lt;/h3&gt;

&lt;p&gt;A VPN encrypts your entire connection, making it more secure, while a proxy only changes your IP for specific requests. VPNs are better for privacy, while proxies are useful for bypassing simple blocks.&lt;/p&gt;

&lt;p&gt;For a detailed comparison, check out our blog:&lt;/p&gt;

&lt;p&gt;[&lt;/p&gt;

&lt;p&gt;Proxy vs VPN: Which One Should You Use?&lt;/p&gt;

&lt;p&gt;Understand the key differences between proxies and VPNs, their use cases, and which one is best for your needs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fproxy-vs-vpn_banner_light.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fproxy-vs-vpn_banner_light.svg" alt="How to Choose the Best Proxy Unblocker?" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
](&lt;a href="https://scrapfly.io/blog/proxy-vs-vpn/" rel="noopener noreferrer"&gt;https://scrapfly.io/blog/proxy-vs-vpn/&lt;/a&gt;)&lt;/p&gt;

&lt;h3&gt;
  
  
  Why do some proxies stop working?
&lt;/h3&gt;

&lt;p&gt;Websites constantly update their blocking methods. If a proxy stops working, it may be blacklisted, detected, or overloaded. Switching to a rotating or residential proxy can help.&lt;/p&gt;

&lt;h3&gt;
  
  
  Are free proxies safe to use?
&lt;/h3&gt;

&lt;p&gt;Free proxies come with risks like slow speeds, data logging, and security threats. For safer browsing, use a trusted paid proxy or VPN.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Choosing the right proxy unblocker is essential for bypassing website restrictions. Proxies work by changing your IP, while proxy savers help optimize bandwidth. Websites block users based on IP, geo-location, and user agents, but alternatives like VPNs, DNS changes, and browser extensions can also help. For web scraping, specialized tools like Scrapfly offer more advanced solutions.&lt;/p&gt;

</description>
      <category>scraperblocking</category>
      <category>proxies</category>
    </item>
    <item>
      <title>Guide To Google Image Search API and Alternatives</title>
      <dc:creator>Scrapfly</dc:creator>
      <pubDate>Wed, 12 Mar 2025 18:03:43 +0000</pubDate>
      <link>https://dev.to/scrapfly_dev/guide-to-google-image-search-api-and-alternatives-13db</link>
      <guid>https://dev.to/scrapfly_dev/guide-to-google-image-search-api-and-alternatives-13db</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fguide-to-google-image-search-api-and-alternatives_banner_light.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fguide-to-google-image-search-api-and-alternatives_banner_light.svg" alt="Guide To Google Image Search API and Alternatives" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;!--kg-card-end: html--&amp;gt;&amp;lt;!--kg-card-begin: markdown--&amp;gt; &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2F2025%2F03%2Fguide-to-list-crawling_banner.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2F2025%2F03%2Fguide-to-list-crawling_banner.svg" alt="Guide To Google Image Search API and Alternatives" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Google Image Search API allows developers to integrate Google Image Search functionality into their applications. This API provides access to a vast collection of images indexed by Google, enabling users to search for images based on various criteria such as keywords, image type, and more.&lt;/p&gt;

&lt;p&gt;Whether you're building an image search feature, creating a visual recognition tool, or developing content analysis software, this guide will help you understand your options for programmatically accessing image search functionality.&lt;/p&gt;

&lt;p&gt;&amp;lt;!--kg-card-end: markdown--&amp;gt;&amp;lt;!--kg-card-begin: markdown--&amp;gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Is There an Official Google Image Search API?
&lt;/h2&gt;

&lt;p&gt;Google previously provided a dedicated Image Search API as part of its AJAX Search API suite, but this service was deprecated in 2011. Since then, developers looking for official Google-supported methods to access image search results have had limited options.&lt;/p&gt;

&lt;p&gt;However, Google does offer a partial solution through its &lt;a href="https://developers.google.com/custom-search/v1/introduction" rel="noopener noreferrer"&gt;Custom Search JSON API&lt;/a&gt;, which can be configured to include image search results. This requires setting up a Custom Search Engine (CSE) and limiting it to image search, but it comes with significant limitations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Quota restrictions&lt;/strong&gt; : The free tier is limited to 100 queries per day&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Commercial use fees&lt;/strong&gt; : Usage beyond the free tier requires payment&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Limited results&lt;/strong&gt; : Each query returns a maximum of 10 images per request&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Restricted customization&lt;/strong&gt; : Fewer filtering options compared to the original Image Search API&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For developers needing more robust image search capabilities, exploring alternative services is often necessary.&lt;/p&gt;

&lt;h2&gt;
  
  
  Google Image Search Alternatives
&lt;/h2&gt;

&lt;p&gt;While Google does not provide an official Image Search API, there are several alternatives available:&lt;/p&gt;

&lt;h3&gt;
  
  
  Bing Image Search API
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.microsoft.com/en-us/bing/apis/bing-image-search-api" rel="noopener noreferrer"&gt;Microsoft's Bing Image Search API&lt;/a&gt; provides a comprehensive solution for integrating image search capabilities into applications. Part of the Azure Cognitive Services suite, this API offers advanced search features and returns detailed metadata about images.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests

subscription_key = "YOUR_SUBSCRIPTION_KEY"
search_url = "https://api.bing.microsoft.com/v7.0/images/search"
search_term = "mountain landscape"

headers = {"Ocp-Apim-Subscription-Key": subscription_key}
params = {"q": search_term, "count": 10, "offset": 0, "mkt": "en-US", "safeSearch": "Moderate"}

response = requests.get(search_url, headers=headers, params=params)
response.raise_for_status()
search_results = response.json()

# Process the results
for image in search_results["value"]:
    print(f"URL: {image['contentUrl']}")
    print(f"Name: {image['name']}")
    print(f"Size: {image['width']}x{image['height']}")
    print("---")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above code, we're sending a request to the Bing Image Search API with our search term and additional parameters. The API returns a JSON response containing image URLs, names, and dimensions, which we can then process according to our application's needs.&lt;/p&gt;

&lt;p&gt;The Bing API offers competitive pricing with a free tier that includes 1,000 transactions per month, making it accessible for small projects and testing before scaling.&lt;/p&gt;

&lt;h3&gt;
  
  
  DuckDuckGo Image Search
&lt;/h3&gt;

&lt;p&gt;DuckDuckGo doesn't offer an official API for image search, but it's worth noting that their image search results are primarily powered by Bing's search engine. For developers looking for a more privacy-focused approach, some have created unofficial wrappers around DuckDuckGo's search functionality.&lt;/p&gt;

&lt;p&gt;Since this method relies on web scraping, you should have prior knowledge of it. If you're interested in learning more about web scraping and best practices, check out our article.&lt;/p&gt;

&lt;p&gt;[&lt;/p&gt;

&lt;p&gt;Everything to Know to Start Web Scraping in Python Today&lt;/p&gt;

&lt;p&gt;Ultimate modern intro to web scraping using Python. How to scrape data using HTTP or headless browsers, parse it using AI and scale and deploy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Feverything-to-know-about-web-scraping-python_banner_light.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Feverything-to-know-about-web-scraping-python_banner_light.svg" alt="Guide To Google Image Search API and Alternatives" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
](&lt;a href="https://scrapfly.io/blog/everything-to-know-about-web-scraping-python/" rel="noopener noreferrer"&gt;https://scrapfly.io/blog/everything-to-know-about-web-scraping-python/&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Now, let's move on to the example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from playwright.sync_api import sync_playwright
from bs4 import BeautifulSoup

def scrape_duckduckgo_images():
    # Start Playwright in a context manager to ensure clean-up
    with sync_playwright() as p:
        # Launch the Chromium browser in non-headless mode for visual debugging
        browser = p.chromium.launch(headless=False)
        page = browser.new_page()

        # Navigate to DuckDuckGo image search for 'python'
        page.goto("https://duckduckgo.com/?q=python&amp;amp;iax=images&amp;amp;ia=images")

        # Wait until the images load by waiting for the image selector to appear
        page.wait_for_selector(".tile--img__img")

        # Get the fully rendered page content including dynamically loaded elements
        content = page.content()

        # Parse the page content using BeautifulSoup for easier HTML traversal
        soup = BeautifulSoup(content, "html.parser")
        images = soup.find_all("img")

        # Loop through the first three images only
        for image in images[:3]:
            # Safely extract the 'src' attribute with a default message if not found
            src = image.get("src", "No src found")
            # Safely extract the 'alt' attribute with a default message if not found
            alt = image.get("alt", "No alt text")
            print(src) # Print the image source URL
            print(alt) # Print the image alt text
            print("---------------------------------")

        # Close the browser after the scraping is complete
        browser.close()

scrape_duckduckgo_images()

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Example Output
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
//external-content.duckduckgo.com/iu/?u=https%3A%2F%2Ftse3.mm.bing.net%2Fth%3Fid%3DOIP.jrcuppJ7JfrVrpa9iKnnnAHaHa%26pid%3DApi&amp;amp;f=1&amp;amp;ipt=a11d9de5b863682e82564114f090c443350005fe945cfdfdba2ca1a05a43fa2b&amp;amp;ipo=images
Advanced Python Tutorials - Real Python
---------------------------------
//external-content.duckduckgo.com/iu/?u=https%3A%2F%2Ftse2.mm.bing.net%2Fth%3Fid%3DOIP.Po6Ot_fcf7ya7xkrOL27hQHaES%26pid%3DApi&amp;amp;f=1&amp;amp;ipt=156829965359c98ab2bbc69fb73e2a4963284ff665c83887d6278d6cecc08841&amp;amp;ipo=images
¿Para qué sirve Python?
---------------------------------
//external-content.duckduckgo.com/iu/?u=https%3A%2F%2Ftse4.mm.bing.net%2Fth%3Fid%3DOIP._zLHmRNYHt-KYwYC8cC3RwHaHa%26pid%3DApi&amp;amp;f=1&amp;amp;ipt=04bdcfc11eee3ef4e96bf7d1b47230633b7c936363cf0c9f86c5dfa2e6fb4f32&amp;amp;ipo=images
¿Qué es Python y por qué debes aprender

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above code, we're making a request to DuckDuckGo's search page with parameters that trigger the image search interface. However, this approach requires web scraping.&lt;/p&gt;

&lt;h2&gt;
  
  
  Can Google Images be Scraped?
&lt;/h2&gt;

&lt;p&gt;Scraping Google Images is technically possible and can be a good approach when API options don't meet your specific requirements. But there are several echnical obstacles that make it a complex and often unreliable approach&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Google Blocks Bots Aggressively&lt;/strong&gt; : Google actively detects and blocks automated scraping, requiring constant evasion tactics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Headless Browsers Required&lt;/strong&gt; : Running Selenium or Puppeteer in headless mode is usually necessary to mimic real users.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Page Structure Changes Frequently&lt;/strong&gt; : Google updates its layout and elements, breaking scrapers that rely on fixed XPath or CSS selectors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;High Resource Consumption&lt;/strong&gt; : Running Selenium-based automation in a full browser environment significantly increases CPU and memory usage compared to API-based solutions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For many applications, using an official API from Bing or another provider is a more sustainable approach. However, for specific use cases or when other options aren't viable, let's explore some effective scraping techniques.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scrapfly Web Scraping API
&lt;/h2&gt;

&lt;p&gt;ScrapFly provides &lt;a href="https://scrapfly.io/docs/scrape-api/getting-started" rel="noopener noreferrer"&gt;web scraping&lt;/a&gt;, &lt;a href="https://scrapfly.io/docs/screenshot-api/getting-started" rel="noopener noreferrer"&gt;screenshot&lt;/a&gt;, and &lt;a href="https://scrapfly.io/docs/extraction-api/getting-started" rel="noopener noreferrer"&gt;extraction&lt;/a&gt; APIs for data collection at scale.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/anti-scraping-protection" rel="noopener noreferrer"&gt;Anti-bot protection bypass&lt;/a&gt; - scrape web pages without blocking!&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/proxy" rel="noopener noreferrer"&gt;Rotating residential proxies&lt;/a&gt; - prevent IP address and geographic blocks.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/javascript-rendering" rel="noopener noreferrer"&gt;JavaScript rendering&lt;/a&gt; - scrape dynamic web pages through cloud browsers.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/javascript-scenario" rel="noopener noreferrer"&gt;Full browser automation&lt;/a&gt; - control browsers to scroll, input and click on objects.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/scrape-api/getting-started#api_param_format" rel="noopener noreferrer"&gt;Format conversion&lt;/a&gt; - scrape as HTML, JSON, Text, or Markdown.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scrapfly.io/docs/sdk/python" rel="noopener noreferrer"&gt;Python&lt;/a&gt; and &lt;a href="https://scrapfly.io/docs/sdk/typescript" rel="noopener noreferrer"&gt;Typescript&lt;/a&gt; SDKs, as well as &lt;a href="https://scrapfly.io/docs/sdk/scrapy" rel="noopener noreferrer"&gt;Scrapy&lt;/a&gt; and &lt;a href="https://scrapfly.io/docs/integration/getting-started" rel="noopener noreferrer"&gt;no-code tool integrations&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fcommon_scrapfly-api.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscrapfly.io%2Fblog%2Fcontent%2Fimages%2Fcommon_scrapfly-api.svg" alt="Guide To Google Image Search API and Alternatives" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's an example of how to scrape a google images with the Scrapfly web scraping API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from scrapfly import ScrapflyClient, ScrapeConfig, ScrapeApiResponse

scrapfly = ScrapflyClient(key="YOUR_SCRAPFLY_KEY")

result: ScrapeApiResponse = scrapfly.scrape(ScrapeConfig(
    tags=[
    "player","project:default"
    ],
    format="json",
    extraction_model="search_engine_results",
    country="us",
    lang=[
    "en"
    ],
    asp=True,
    render_js=True,
    url="https://www.google.com/search?q=python&amp;amp;tbm=isch"
))

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Example Output
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
{
    "query": "python - Google Search",
    "results": [
        {
            "displayUrl": null,
            "publishDate": null,
            "richSnippet": null,
            "snippet": null,
            "title": "Wikipedia Python (programming language) - Wikipedia",
            "url": "https://en.wikipedia.org/wiki/Python_(programming_language)"
        },
        {
            "displayUrl": null,
            "publishDate": null,
            "richSnippet": null,
            "snippet": null,
            "title": "Juni Learning What is Python Coding? | Juni Learning",
            "url": "https://junilearning.com/blog/guide/what-is-python-101-for-students/"
        },
        {
            "displayUrl": null,
            "publishDate": null,
            "richSnippet": null,
            "snippet": null,
            "title": "Wikiversity Python - Wikiversity",
            "url": "https://en.wikiversity.org/wiki/Python"
        },
        ...
   }

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://scrapfly.io/register" rel="noopener noreferrer"&gt;Try for FREE!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scrapfly.io/docs" rel="noopener noreferrer"&gt;More on Scrapfly&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Scrape Google Image Search using Python
&lt;/h2&gt;

&lt;p&gt;For a direct approach to scraping Google Images using Python, the following code demonstrates how to extract image data using Requests and &lt;a href="https://scrapfly.io/blog/web-scraping-with-python-beautifulsoup/" rel="noopener noreferrer"&gt;BeautifulSoup&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests
from bs4 import BeautifulSoup
import random
import time
from lxml import etree # For XPath support

def scrape_google_images_bs4(query, num_results=20):
    # Encode the search query
    encoded_query = query.replace(" ", "+")
    # Set up headers to mimic a browser
    user_agents = [
        "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
        "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36"
    ]
    headers = {
        "User-Agent": random.choice(user_agents),
        "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
        "Accept-Language": "en-US,en;q=0.5",
        "Referer": "https://www.google.com/"
    }

    # Make the request
    url = f"https://www.google.com/search?q={encoded_query}&amp;amp;tbm=isch"
    response = requests.get(url, headers=headers)

    if response.status_code != 200:
        print(f"Failed to retrieve the page: {response.status_code}")
        return []

    # Parse the HTML using both BeautifulSoup and lxml for XPath
    soup = BeautifulSoup(response.text, 'html.parser')
    dom = etree.HTML(str(soup)) # Convert to lxml object for XPath

    # Process the response
    image_data = []

    # Use XPath to select divs instead of class-based selection
    # This pattern selects all similar divs in the structure
    base_xpath = "/html/body/div[3]/div/div[14]/div/div[2]/div[2]/div/div/div/div/div[1]/div/div/div"

    # Get all div indices to match the pattern
    div_indices = range(1, num_results + 1) # Start with 1 through num_results

    for i in div_indices:
        try:
            # Create XPath for the current div
            current_xpath = f"{base_xpath}[{i}]"
            div_element = dom.xpath(current_xpath)

            if not div_element:
                continue

            item = {}

            # Get the data-lpage attribute (page URL) from the div
            page_url_xpath = f"{current_xpath}/@data-lpage"
            page_url = dom.xpath(page_url_xpath)
            if page_url:
                item["page_url"] = page_url[0]

            # Get the alt text of the image
            alt_xpath = f"{current_xpath}//img/@alt"
            alt_text = dom.xpath(alt_xpath)
            if alt_text:
                item["alt_text"] = alt_text[0]

            if item:
                image_data.append(item)

            # Stop if we've reached the requested number of results
            if len(image_data) &amp;gt;= num_results:
                break

        except Exception as e:
            print(f"Error processing element {i}: {e}")

    return image_data

# Example usage
image_data = scrape_google_images_bs4("python", num_results=5)
print(image_data)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Example Output
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
[{'page_url': 'https://en.wikipedia.org/wiki/Python_(programming_language)', 'alt_text': '\u202aPython (programming language) - Wikipedia\u202c\u200f'},
{'page_url': 'https://beecrowd.com/blog-posts/best-python-courses/', 'alt_text': '\u202aPython: find out the best courses - beecrowd\u202c\u200f'},
{'page_url': 'https://junilearning.com/blog/guide/what-is-python-101-for-students/', 'alt_text': '\u202aWhat is Python Coding? | Juni Learning\u202c\u200f'},
{'page_url': 'https://medium.com/towards-data-science/what-is-a-python-environment-for-beginners-7f06911cf01a', 'alt_text': "\u202aWhat Is a 'Python Environment'? (For Beginners) | by Mark Jamison | TDS Archive | Medium\u202c\u200f"},
{'page_url': 'https://quantumzeitgeist.com/why-is-the-python-programming-language-so-popular/', 'alt_text': '\u202aWhy Is The Python Programming Language So Popular?\u202c\u200f'}]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above code, we created a Google Images scraper that uses &lt;code&gt;XPath&lt;/code&gt; targeting instead of class-based selectors for better reliability. The script mimics browser behavior with rotating user agents, fetches search results for a given query, and extracts both the source page URL (&lt;code&gt;data-lpage&lt;/code&gt; attribute) and &lt;code&gt;image alt text&lt;/code&gt; from the search results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scrape Google Reverse Image Search using Python
&lt;/h2&gt;

&lt;p&gt;Reverse image search allows you to find similar images and their sources using an image as the query instead of text. Implementing this requires a slightly different approach, often involving browser automation with tools like &lt;a href="https://scrapfly.io/blog/web-scraping-with-selenium-and-python/" rel="noopener noreferrer"&gt;Selenium&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from webdriver_manager.chrome import ChromeDriverManager
import time

def google_reverse_image_search(image_url, max_results=5):
    # Set up Chrome options
    chrome_options = Options()
    # chrome_options.add_argument("--headless") # Run in headless mode
    chrome_options.add_argument("--no-sandbox")
    chrome_options.add_argument("--disable-dev-shm-usage")
    chrome_options.add_argument("--disable-gpu")
    chrome_options.add_argument("--window-size=1920,1080")
    chrome_options.add_argument("--lang=en-US,en")
    chrome_options.add_experimental_option('prefs', {'intl.accept_languages': 'en-US,en'})
    chrome_options.add_experimental_option("excludeSwitches", ["enable-automation"])
    chrome_options.add_experimental_option('useAutomationExtension', False)
    chrome_options.add_argument("--disable-blink-features=AutomationControlled")
    chrome_options.add_argument("user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36")

    # Initialize the driver
    driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options)

    try:
        # Navigate to Google Images
        driver.get("https://www.google.com/imghp?hl=en&amp;amp;gl=us")

        # Find and click the camera icon for reverse search
        camera_button = WebDriverWait(driver, 10).until(
            EC.element_to_be_clickable((By.XPATH, "//div[@aria-label='Search by image']"))
        )
        camera_button.click()

        # Wait for the URL input field and enter the image URL
        url_input = WebDriverWait(driver, 10).until(
            EC.presence_of_element_located((By.XPATH, "//input[@placeholder='Paste image link']"))
        )
        url_input.send_keys(image_url)

        # Click search button
        search_button = WebDriverWait(driver, 10).until(
            EC.element_to_be_clickable((By.XPATH, "//div[text()='Search']"))
        )
        search_button.click()

        # Wait for results page to load
        WebDriverWait(driver, 15).until(
            EC.presence_of_element_located((By.XPATH, "//div[contains(text(), 'All')]"))
        )

        # Extract similar image results
        similar_images = []

        # Click on "Find similar images" if available
        try:
            # Extract image data
            for i in range(max_results):
                try:
                    # Get image element using index in XPath
                    img_xpath = f"/html/body/div[3]/div/div[12]/div/div/div[2]/div[2]/div/div/div[1]/div/div/div/div/div/div/div[{i+1}]/div/div/div[1]/div/div/div/div/img"
                    img = WebDriverWait(driver, 5).until(
                        EC.presence_of_element_located((By.XPATH, img_xpath))
                    )

                    # Get image URL by clicking and extracting from larger preview
                    img.click()
                    time.sleep(1) # Wait for larger preview

                    # Find the large image
                    img_container = WebDriverWait(driver, 5).until(
                        EC.presence_of_element_located((By.XPATH, "//*[@id='Sva75c']/div[2]/div[2]/div/div[2]/c-wiz/div/div[2]/div/a[1]"))
                    )

                    img_url = driver.find_element(By.XPATH, "//*[@id='Sva75c']/div[2]/div[2]/div/div[2]/c-wiz/div/div[2]/div/a[1]/img").get_attribute("src")

                    # Get source website
                    source_url = img_container.get_attribute("href")

                    similar_images.append({
                        "url": img_url,
                        "source_url": source_url,
                    })
                except Exception as e:
                    print(f"Error extracting image {i+1}: {e}")
        except Exception as e:
            print(f"Could not find 'similar images' link: {e}")

        return similar_images

    finally:
        # Clean up
        driver.quit()

# Example usage
sample_image_url = "https://avatars.githubusercontent.com/u/54183743?s=280&amp;amp;v=4"
similar_images = google_reverse_image_search(sample_image_url)

print("Similar Images:")
for idx, img in enumerate(similar_images, 1):
    print(f"Image {idx}:")
    print(f" URL: {img['url']}")
    print(f" Source: {img['source_url']}")
    print()

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above code, we're using Selenium to automate the process of performing a reverse image search. This approach simulates a user visiting Google Images, clicking the camera icon, entering an image URL, and initiating the search. The full implementation would include parsing the results page to extract similar images, websites containing the image, and other relevant information.&lt;/p&gt;

&lt;p&gt;This method requires more resources than simple HTTP requests but provides access to functionality that isn't easily available through direct scraping. For production use, you would need to add error handling, result parsing, and potentially proxy rotation to avoid detection.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Is there an official Google Image Search API?
&lt;/h3&gt;

&lt;p&gt;No, Google does not offer an official Image Search API. The previously available Google Image Search API was deprecated and is no longer supported.&lt;/p&gt;

&lt;h3&gt;
  
  
  What are the alternatives to Google Image Search API?
&lt;/h3&gt;

&lt;p&gt;Alternatives to Google Image Search API include Bing Image Search API, DuckDuckGo Image Search, and image search APIs from other search engines like Yahoo and Yandex.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I scrape Google Images?
&lt;/h3&gt;

&lt;p&gt;Scraping Google Images is possible, but it comes with challenges and legal considerations. It's important to use ethical scraping practices and consider using APIs provided by other search engines as alternatives.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In this article, we explored the Google Image Search API, its alternatives, and how to scrape Google Image Search results using Python. While Google does not offer an official Image Search API, developers can use the Google Custom Search JSON API or alternatives like Bing Image Search API and DuckDuckGo Image Search. Additionally, we discussed the challenges of scraping Google Images and provided example code snippets for scraping image search results.&lt;/p&gt;

</description>
      <category>api</category>
    </item>
  </channel>
</rss>
