<?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: Barbie Forteza</title>
    <description>The latest articles on DEV Community by Barbie Forteza (@barbie_forteza_918f35a9d8).</description>
    <link>https://dev.to/barbie_forteza_918f35a9d8</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4275239%2F4466b393-3151-4959-9796-dca7d3aa483b.jpg</url>
      <title>DEV Community: Barbie Forteza</title>
      <link>https://dev.to/barbie_forteza_918f35a9d8</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/barbie_forteza_918f35a9d8"/>
    <language>en</language>
    <item>
      <title>A practical guide on scraping Rakuten Products with Python</title>
      <dc:creator>Barbie Forteza</dc:creator>
      <pubDate>Tue, 01 Dec 2026 12:29:31 +0000</pubDate>
      <link>https://dev.to/barbie_forteza_918f35a9d8/a-practical-guide-on-scraping-rakuten-products-with-python-2h00</link>
      <guid>https://dev.to/barbie_forteza_918f35a9d8/a-practical-guide-on-scraping-rakuten-products-with-python-2h00</guid>
      <description>&lt;p&gt;Tracking prices on Rakuten Ichiba gets interesting when two stores sell similar products at different prices and offer different reward points. A price tracker that ignores those points can miss changes in the value of an offer entirely.&lt;/p&gt;

&lt;p&gt;If you're looking for how to scrape Rakuten products with Python, this tutorial shows how to collect product listings, prices, reward points, shop information and review scores using an open-source scraper.&lt;/p&gt;

&lt;p&gt;You'll also build a small Python script that compares two snapshots and identifies changes in prices and reward points independently.&lt;/p&gt;

&lt;p&gt;The project uses the MIT-licensed Rakuten Scraper. You can also find its corresponding Rakuten entry on ScrapingReview.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to scrape Rakuten products in six steps
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Clone the Rakuten scraper repository from GitHub.&lt;/li&gt;
&lt;li&gt;Create a Python virtual environment.&lt;/li&gt;
&lt;li&gt;Install the dependencies and Playwright Chromium.&lt;/li&gt;
&lt;li&gt;Run the scraper against a Rakuten Ichiba search URL.&lt;/li&gt;
&lt;li&gt;Check the run status and export the products to JSON and CSV.&lt;/li&gt;
&lt;li&gt;Compare two snapshots using Python to identify price and reward point changes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The basic setup requires no API key, proxy or Rakuten account.&lt;/p&gt;

&lt;h2&gt;
  
  
  What product data can you extract from Rakuten?
&lt;/h2&gt;

&lt;p&gt;The scraper supports keyword searches, genre listings and individual product pages on Rakuten Ichiba, the Japanese marketplace at rakuten.co.jp.&lt;/p&gt;

&lt;p&gt;It returns 42 fields per product, covering listings, merchants and marketplace-specific pricing attributes.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Data type&lt;/th&gt;
&lt;th&gt;Extracted fields&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Product information&lt;/td&gt;
&lt;td&gt;Titles, SKUs, URLs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Categories&lt;/td&gt;
&lt;td&gt;Categories, genre IDs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pricing&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;price&lt;/code&gt;, &lt;code&gt;currency&lt;/code&gt;, &lt;code&gt;price_max&lt;/code&gt;, &lt;code&gt;subscription_price&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rewards&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;points&lt;/code&gt;, &lt;code&gt;point_rate&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Merchant information&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;shop_name&lt;/code&gt;, &lt;code&gt;shop_code&lt;/code&gt;, &lt;code&gt;shop_id&lt;/code&gt;, &lt;code&gt;shop_url&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reviews&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;rating&lt;/code&gt;, &lt;code&gt;review_count&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Shipping&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;shipping_fee&lt;/code&gt;, &lt;code&gt;free_shipping&lt;/code&gt;, &lt;code&gt;delivery_estimate&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Product variants&lt;/td&gt;
&lt;td&gt;Variant prices, variant count&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Prices on the tested Japanese marketplace are in JPY. Product titles, categories and merchant names remain in Japanese.&lt;/p&gt;

&lt;p&gt;For price monitoring, the most useful identifier is &lt;code&gt;sku&lt;/code&gt;. Rakuten combines the shop code and item code into a single identifier, making it possible to match the same merchant's listing across multiple runs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up the Rakuten scraper
&lt;/h2&gt;

&lt;p&gt;You'll need Python 3.9 or newer. The repository's offline test suite covers Python 3.9 and 3.13.&lt;/p&gt;

&lt;p&gt;Clone the repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/2scraper/rakuten-scraper.git
&lt;span class="nb"&gt;cd&lt;/span&gt; rakuten-scraper
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a virtual environment and install the dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 -m venv .venv &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; . .venv/bin/activate
pip install -r requirements.txt -r requirements-playwright.txt
playwright install chromium
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These commands use a Bash-compatible shell.&lt;/p&gt;

&lt;p&gt;Playwright is the recommended browser engine. Selenium and pyppeteer are also supported, but installing all three in the same virtual environment can introduce dependency conflicts.&lt;/p&gt;

&lt;p&gt;For the first run, you don't need a &lt;code&gt;.env&lt;/code&gt; file or any credentials.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scraping Rakuten search results with Python
&lt;/h2&gt;

&lt;p&gt;Suppose you're monitoring wireless earphones sold by Japanese retailers. The Japanese search term for wireless earphones is ワイヤレスイヤホン.&lt;/p&gt;

&lt;p&gt;Run the scraper against the search URL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 playwright_scraper.py \
  --url &lt;span class="s2"&gt;"https://search.rakuten.co.jp/search/mall/ワイヤレスイヤホン/"&lt;/span&gt; \
  --pages 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;--pages&lt;/code&gt; argument controls how many result pages the scraper requests. Rakuten serves 45 product listings per page, so three full pages can produce 135 records.&lt;/p&gt;

&lt;p&gt;After a successful run, the scraper produces:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rakuten_products.json
rakuten_products.csv
rakuten_products.meta.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The JSON file is convenient for Python processing. The CSV file can be opened in a spreadsheet, while the metadata file tells you whether the collection completed successfully.&lt;/p&gt;

&lt;p&gt;Always check the metadata before importing the results into another application. An existing CSV file does not necessarily mean your latest scrape succeeded.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Rakuten requires careful data extraction
&lt;/h2&gt;

&lt;p&gt;Several details in Rakuten's page structure can cause a scraper to return incomplete or misleading data.&lt;/p&gt;

&lt;h3&gt;
  
  
  The structured data contains different products
&lt;/h3&gt;

&lt;p&gt;A search page contains an &lt;code&gt;application/ld+json&lt;/code&gt; block with ten products belonging to a recommendation carousel. The actual search results contain 45 products per page.&lt;/p&gt;

&lt;p&gt;Instead of treating JSON-LD as the primary product source, the scraper reads the listing payload from:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;window.__INITIAL_STATE__.state.data.ichibaSearch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The payload contains products and pagination information. JSON-LD is used to obtain the currency on the first page.&lt;/p&gt;

&lt;h3&gt;
  
  
  Product pages use a different structure
&lt;/h3&gt;

&lt;p&gt;Individual item pages expose their data through a script element with the ID &lt;code&gt;item-page-app-data&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The scraper extracts product information from:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;newApi.itemInfoSku
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Product pages can also use EUC-JP encoding, while listing pages use UTF-8. Using a browser engine avoids having to handle those response encodings manually.&lt;/p&gt;

&lt;h3&gt;
  
  
  A successful request can still contain the wrong page
&lt;/h3&gt;

&lt;p&gt;Requesting a page beyond Rakuten's pagination limit can return the first page again.&lt;/p&gt;

&lt;p&gt;The scraper checks the offset reported in the actual response rather than assuming the requested page number is correct. This prevents a long collection from repeatedly saving the same first-page products.&lt;/p&gt;

&lt;h2&gt;
  
  
  From search results to individual product pages
&lt;/h2&gt;

&lt;p&gt;Search results are useful for discovering products and comparing merchants. Individual product pages provide additional information, including variant prices and verified original prices when available.&lt;/p&gt;

&lt;p&gt;The workflow looks 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;Rakuten keyword search
        |
        v
Product listings and merchant data
        |
        v
Extract product URLs and SKUs
        |
        v
Scrape individual product pages
        |
        v
Collect variant prices and verified original prices
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The repository includes this product-mode example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 playwright_scraper.py --mode product \
  --url &lt;span class="s2"&gt;"https://item.rakuten.co.jp/sawaicoffee-tea/solandluna/"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the earphone monitoring project, substitute a product URL collected from your own search results.&lt;/p&gt;

&lt;p&gt;A missing original price should remain missing rather than being estimated from promotional text in a product title.&lt;/p&gt;

&lt;h2&gt;
  
  
  Handling CAPTCHAs, rate limits and blocked requests
&lt;/h2&gt;

&lt;p&gt;Rakuten's supported listing and item routes worked with an ordinary browser in the repository's documented tests. There was no requirement for a paid scraping service.&lt;/p&gt;

&lt;p&gt;However, the scraper includes optional integrations for remote browser infrastructure, proxies and CAPTCHA solving.&lt;/p&gt;

&lt;h3&gt;
  
  
  Understanding access refusals and HTTP 503
&lt;/h3&gt;

&lt;p&gt;According to the repository's measurements, Rakuten uses Akamai.&lt;/p&gt;

&lt;p&gt;An access refusal can arrive with HTTP 200 and a response body of only 42–43 bytes. Checking the HTTP status alone is therefore insufficient to establish whether a product page was returned.&lt;/p&gt;

&lt;p&gt;HTTP 503 can indicate excessive request frequency. The scraper handles throttling by waiting for 6, 15 and 30 seconds before exhausting its retry sequence.&lt;/p&gt;

&lt;p&gt;If throttling persists, reduce your collection frequency and increase &lt;code&gt;--delay&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  When a remote scraping browser is useful
&lt;/h3&gt;

&lt;p&gt;For server deployments where maintaining Chromium is inconvenient, the scraper supports the &lt;a href="https://2captcha.com/scraper/browser-api" rel="noopener noreferrer"&gt;2Captcha Scraping Browser&lt;/a&gt; API through the &lt;code&gt;RAKUTEN_CDP_ENDPOINT&lt;/code&gt; environment variable. Keep your authenticated endpoint in &lt;code&gt;.env&lt;/code&gt; rather than your Python source or command history. Proxy configuration is also supported through &lt;code&gt;RAKUTEN_PROXY&lt;/code&gt;, but neither integration is required for this tutorial.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does Rakuten require CAPTCHA solving?
&lt;/h3&gt;

&lt;p&gt;The repository examined 13 page captures and found no configured CAPTCHA widgets on the supported routes.&lt;/p&gt;

&lt;p&gt;Although the scraper integrates reCAPTCHA v2/v3 solving through 2Captcha, there was no CAPTCHA to solve during those tests.&lt;/p&gt;

&lt;p&gt;An access refusal without a CAPTCHA widget is not a CAPTCHA-solving task. Adding a solver would not address that response.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the JSON and CSV output
&lt;/h2&gt;

&lt;p&gt;Here is a shortened selection of fields from a real record in the repository's &lt;code&gt;sample_output.json&lt;/code&gt;, collected on September 21, 2026:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"source"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"rakuten.co.jp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"scraped_at"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2026-09-21T09:22:22.033307+00:00"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://item.rakuten.co.jp/ajinomoto/r4901111371248/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"sku"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"ajinomoto:r4901111371248"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"price"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;2447.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"currency"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"JPY"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"original_price"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"discount_pct"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"points"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;220&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"point_rate"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"rating"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;4.76&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"review_count"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;475&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"shipping_fee"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"free_shipping"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"shop_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"味の素グループ公式ショップ"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"price_source"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"state"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This historical coffee listing shows a product priced at ¥2,447 with 220 advertised reward points and free shipping.&lt;/p&gt;

&lt;p&gt;The points are rewards earned through the purchase, not an immediate reduction in the amount charged.&lt;/p&gt;

&lt;p&gt;That's why a Rakuten price tracker should preserve both values rather than subtracting points from the price and saving the result as the actual selling price.&lt;/p&gt;

&lt;p&gt;If you prefer working exclusively with spreadsheets, use the CSV-only output option:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 playwright_scraper.py \
  --url &lt;span class="s2"&gt;"https://search.rakuten.co.jp/search/mall/ワイヤレスイヤホン/"&lt;/span&gt; \
  --pages 3 --format csv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Building a Rakuten price tracker in Python
&lt;/h2&gt;

&lt;p&gt;A single scrape gives you a snapshot. Two scrapes let you see what changed.&lt;/p&gt;

&lt;p&gt;Start by saving the first collection:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 playwright_scraper.py \
  --url &lt;span class="s2"&gt;"https://search.rakuten.co.jp/search/mall/ワイヤレスイヤホン/"&lt;/span&gt; \
  --pages 3 --out monday
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the same search again at your next monitoring interval:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 playwright_scraper.py \
  --url &lt;span class="s2"&gt;"https://search.rakuten.co.jp/search/mall/ワイヤレスイヤホン/"&lt;/span&gt; \
  --pages 3 --out tuesday
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use the same search URL, filters, page count and browser engine for both runs.&lt;/p&gt;

&lt;p&gt;The repository's &lt;code&gt;diff_runs.py&lt;/code&gt; already compares prices and points, including &lt;code&gt;point_rate&lt;/code&gt;. The short script below prints a compact per-shop listing summary for this project.&lt;/p&gt;

&lt;p&gt;Save the following as &lt;code&gt;track_prices.py&lt;/code&gt;:&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="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pathlib&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;Path&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;load_run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;meta&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="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{prefix}.meta.json"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"utf-8"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="s2"&gt;"complete"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;ValueError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"Incomplete run: {prefix}"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;rows&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="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{prefix}.json"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"utf-8"&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="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"sku"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;


&lt;span class="n"&gt;old&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;load_run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"monday"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;load_run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"tuesday"&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;sku&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;old&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;old&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;sku&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;sku&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"currency"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="s2"&gt;"JPY"&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"currency"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="s2"&gt;"JPY"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;continue&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"price_source"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"price_source"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;continue&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"price"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"price"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"points"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"points"&lt;/span&gt;&lt;span class="p"&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;continue&lt;/span&gt;

    &lt;span class="n"&gt;price_change&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"price"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"price"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;points_change&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"points"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"points"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;price_change&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;points_change&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;continue&lt;/span&gt;

    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"SKU: {sku}"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"Shop: {b.get('shop_name', 'Unknown')}"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"Price change: {price_change:+,.0f} JPY"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"Points change: {points_change:+,}"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"-"&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 track_prices.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The script uses only Python's standard library, so there are no additional packages to install.&lt;/p&gt;

&lt;p&gt;This is a custom processing script written for this tutorial, not a bundled repository file. Its output depends on the two snapshots you collect.&lt;/p&gt;

&lt;p&gt;A negative price change indicates that the listed price decreased. A positive points change indicates that the advertised reward increased.&lt;/p&gt;

&lt;p&gt;The script ignores products missing from either snapshot because disappearing from the first three search pages does not prove that a product was removed from the marketplace.&lt;/p&gt;

&lt;p&gt;It also skips records whose &lt;code&gt;price_source&lt;/code&gt; changed, avoiding comparisons between prices obtained from different extraction sources.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations to consider before scheduling your scraper
&lt;/h2&gt;

&lt;p&gt;Rakuten's search results have a hard limit of 6,750 accessible products per query, corresponding to 150 pages of 45 products.&lt;/p&gt;

&lt;p&gt;A query can match millions of products while exposing only that subset. Check &lt;code&gt;total_results&lt;/code&gt;, &lt;code&gt;reachable_max&lt;/code&gt; and &lt;code&gt;capped_by_site&lt;/code&gt; in the metadata before treating your dataset as representative of the marketplace.&lt;/p&gt;

&lt;p&gt;Other limitations include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Listing pages do not expose verified original prices or discount percentages.&lt;/li&gt;
&lt;li&gt;Merchant storefronts and ranking pages are not supported.&lt;/li&gt;
&lt;li&gt;Individual review text is not part of the output schema.&lt;/li&gt;
&lt;li&gt;Products without reviews have null ratings and review counts.&lt;/li&gt;
&lt;li&gt;Search results exclude sold-out items, limiting inventory monitoring.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--locale en&lt;/code&gt; does not translate merchant-authored product information.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For scheduled jobs, pay attention to exit codes:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Exit code&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;Products written&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Crash&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Incorrect usage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Blocked before parsing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Page served but no products found&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;Content could not be obtained&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Partial run&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A failed or partial collection should not become the baseline for your next price comparison.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is scraping Rakuten legal?
&lt;/h2&gt;

&lt;p&gt;Collect only publicly available information and review Rakuten's terms of use and &lt;code&gt;robots.txt&lt;/code&gt; before starting. Keep your request rate moderate, respect access restrictions and consider copyright when storing product descriptions or images.&lt;/p&gt;

&lt;p&gt;If your collection involves personal information, comply with applicable privacy legislation, including GDPR where relevant. This tutorial is not legal advice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Can I scrape Rakuten products without an API key?
&lt;/h3&gt;

&lt;p&gt;Yes. The open-source scraper reads public listing and product pages without requiring an API key, proxy or account. A documented three-page run returned 135 products with exit code 0.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do I need the Rakuten API to collect product prices?
&lt;/h3&gt;

&lt;p&gt;No. This scraper reads data embedded in Rakuten's public pages rather than using its developer API. It extracts prices, points, merchant information and review scores directly from those pages.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do I export Rakuten product data to CSV?
&lt;/h3&gt;

&lt;p&gt;The scraper generates &lt;code&gt;rakuten_products.csv&lt;/code&gt; alongside its JSON output by default. Use &lt;code&gt;--format csv&lt;/code&gt; if you only need CSV output.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I scrape Rakuten product reviews with Python?
&lt;/h3&gt;

&lt;p&gt;You can extract aggregate ratings and review counts. Individual review comments and reviewer profiles are not included in the scraper's product schema.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do I scrape Rakuten without getting blocked?
&lt;/h3&gt;

&lt;p&gt;Start with the default Playwright configuration, keep your request frequency moderate and respect the site's access restrictions. If you encounter HTTP 503, increase the delay between requests.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I track Rakuten discounts and reward points separately?
&lt;/h3&gt;

&lt;p&gt;Yes. The scraper stores &lt;code&gt;price&lt;/code&gt;, &lt;code&gt;points&lt;/code&gt; and &lt;code&gt;point_rate&lt;/code&gt; independently. Verified original prices are available on supported product pages when published. Comparing these fields across snapshots helps distinguish price changes from reward campaigns.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with a small product dataset
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://github.com/2scraper/rakuten-scraper" rel="noopener noreferrer"&gt;Rakuten scraper on GitHub&lt;/a&gt; is a practical starting point for experimenting with Japanese marketplace data.&lt;/p&gt;

&lt;p&gt;Additional project information is available on the &lt;a href="https://2scraper.com/scrapers/rakuten-scraper/" rel="noopener noreferrer"&gt;Rakuten scraper page on 2scraper.com&lt;/a&gt; and its corresponding entry on ScrapingReview.&lt;/p&gt;

&lt;p&gt;If your deployment requires managed browser infrastructure, evaluate the optional 2Captcha integration separately from your local scraper setup. The &lt;a href="https://2captcha.com/h/how-to-scrape-rakuten" rel="noopener noreferrer"&gt;How to Scrape Rakuten guide on 2Captcha&lt;/a&gt; provides a full reference of the available options.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Disclosure: This article was prepared with AI assistance and is based on the scraper's repository documentation, changelog and recorded test data.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webscraping</category>
      <category>tutorial</category>
      <category>automation</category>
      <category>python</category>
    </item>
  </channel>
</rss>
