LogoLogo
OverviewRelease NotesDataPipelineFAQs
Ruby
Ruby
  • Make Requests with ScraperAPI in Ruby
    • Use ScraperAPI Endpoint in Ruby
    • Use ScraperAPI Proxy Port in Ruby
    • Use ScraperAPI SDK in Ruby
    • Make Async Requests with ScraperAPI in Ruby
      • How to Use ScraperAPI Async Web Scraping in Ruby
      • Use Async ScraperAPI Callbacks in Ruby
      • Configure ScraperAPI Parameters in Ruby
      • Request Async Batch Scraping with ScraperAPI in Ruby
      • Decode Base64 Async Responses in Ruby
    • ScraperAPI Structured Data Collection in Ruby
      • Amazon Product Page API: Structured Data in Ruby
      • Amazon Search API: Structured Data in Ruby
      • Amazon Offers API: Structured Data in Ruby
      • Amazon Reviews API: Structured Data in Ruby
      • Ebay Product Page API: Structured Data in Ruby
      • Ebay Search API: Structured Data in Ruby
      • Google SERP API: Structured Data in Ruby
      • Google News API: Structured Data in Ruby
      • Google Jobs API: Structured Data in Ruby
      • Google Shopping API: Structured Data in Ruby
      • Google Maps Search API: Structured Data in Ruby
      • Redfin Agent Details API: Structured Data in Ruby
      • Redfin 'For Rent' Listings API: Structured Data in Ruby
      • Redfin 'For Sale' Listings API: Structured Data in Ruby
      • Redfin Listing Search API: Structured Data in Ruby
      • Walmart Search API: Structured Data in Ruby
      • Walmart Category API: Structured Data in Ruby
      • Walmart Product API: Structured Data in Ruby
      • Walmart Reviews API: Structured Data in Ruby
    • ScraperAPI Async Structured Data Collection in Ruby
      • Amazon Product Page API: Async Structured Data in Ruby
      • Amazon Search API: Async Structured Data in Ruby
      • Amazon Offers API: Async Structured Data in Ruby
      • Amazon Reviews API: Async Structured Data in Ruby
      • Ebay Product Page API: Async Structured Data in Ruby
      • Ebay Search API: Async Structured Data in Ruby
      • Google SERP API: Async Structured Data in Ruby
      • Google News API: Async Structured Data in Ruby
      • Google Jobs API: Async Structured Data in Ruby
      • Google Shopping API: Async Structured Data in Ruby
      • Google Maps Search API: Async Structured Data in Ruby
      • Redfin Agent Details API: Async Structured Data in Ruby
      • Redfin 'For Rent' Listings API: Async Structured Data in Ruby
      • Redfin 'For Sale' Listings API: Async Structured Data in Ruby
      • Redfin Listing Search API: Async Structured Data in Ruby
      • Walmart Search API: Async Structured Data in Ruby
      • Walmart Category API: Async Structured Data in Ruby
      • Walmart Product API: Async Structured Data in Ruby
      • Walmart Reviews API: Async Structured Data in Ruby
    • Making POST/PUT Requests with ScraperAPI in Ruby
    • Customizing ScraperAPI Requests in Ruby
      • Customize Amazon Requests by ZIP Code via ScraperAPI in Ruby
      • Customize Cached Results via ScraperAPI in Ruby
      • Customize Control Costs with ScraperAPI Parameter in Ruby
      • Send Custom Headers with ScraperAPI in Ruby
      • Customize Device Type with ScraperAPI in Ruby
      • Customize Geotargeted Content Scrape via ScraperAPI in Ruby
      • Customize Premium Geotargeted Scrape via ScraperAPI in Ruby
      • Customize Header Parameter with ScraperAPI in Ruby
      • Customize Premium Residential/Mobile Proxies in Ruby
      • Customize JavaScript-Rendered Pages via ScraperAPI in Ruby
        • Use Render Instruction Set to Scrape Dynamic Pages in Ruby
        • Customize Taking a Website Screenshots via ScraperAPI in Ruby
      • Customize Scrape Session-Based Proxies via ScraperAPI in Ruby
  • Handle and Process Responses via ScraperAPI in Ruby
    • Use API Status Codes to Retry Failed Requests in Ruby
    • Customize Output Formats via ScraperAPI Parameters in Ruby
      • Request JSON Response via Autoparse Parameter in Ruby
      • Request LLM Output Formats with ScraperAPI in Ruby
    • Request Response Encoding and Content-Type via ScraperAPI in Ruby
  • Dashboard & Billing
    • API Key
    • Credit Usage
    • Delete Account
    • Invoice History
    • Billing Email
    • Billing Address
    • VAT Number
    • Payment Method
    • Cancel Subscription
  • Credits and Requests
  • Monitor Your ScraperAPI Account Information in Ruby
  • Documentation Overview
Powered by GitBook

Quick links

  • Homepage
  • Dashboard
  • Pricing
  • Contact Sales

Resources

  • Developer Guides
  • Blog
  • Contact Support
  • Learning Hub
On this page

Was this helpful?

  1. Make Requests with ScraperAPI in Ruby
  2. ScraperAPI Structured Data Collection in Ruby

Amazon Offers API: Structured Data in Ruby

Scrape Amazon product offers into structured data JSON/CSV with ScraperAPI in Ruby. Track competing sellers, prices, and fulfillment methods by ASIN.

This endpoint will retrieve offers for a specified product from an Amazon offers page and transform it into usable JSON or CSV.

require 'net/http'
require 'json'
params = {
:api_key => "APIKEY",
:asin => "ASIN",
:country => "COUNTRY",
:tld => "TLD"
}
uri = URI('https://api.scraperapi.com/structured/amazon/offers')
uri.query = URI.encode_www_form(params)
website_content = Net::HTTP.get(uri)
print(website_content)

Parameters
Details

API_KEY(required)

User account’s normal API key.

ASIN(required)

Amazon Standard Identification Number. Please not that ASIN's are market specific (TLD). You can usually find the ASINs in the URL of an Amazon product e.g. B07FTKQ97Q

TLD

Amazon market to be scraped.

Valid values include:

com (amazon.com)

co.uk (amazon.co.uk)

ca (amazon.ca)

de (amazon.de)

es (amazon.es)

fr (amazon.fr)

it (amazon.it)

co.jp (amazon.co.jp)

in (amazon.in)

cn (amazon.cn)

com.sg (amazon.com.sg)

com.mx (amazon.com.mx)

ae (amazon.ae)

com.br (amazon.com.br)

nl (amazon.nl)

com.au (amazon.com.au)

com.tr (amazon.com.tr)

sa (amazon.sa)

se (amazon.se)

pl (amazon.pl)

COUNTRY

Valid values are two letter country codes for which we offer Geo Targeting (e.g. “au”, “es”, “it”, etc.).

Where an amazon domain needs to be scraped from another country (e.g. scraping amazon.com from Canada to get Canadian shipping information), both TLD and COUNTRY parameters must be specified.

OUTPUT_FORMAT

For structured data methods we offer CSV and JSON output. JSON is default if parameter is not added. Options:

  • csv

  • json

F_NEW

Boolean parameter with a possible value of true or false indicating the condition of the listed items.

F_USED_GOOD

Boolean parameter with a possible value of true or false indicating the condition of the listed items.

F_USED_LIKE_NEW

Boolean parameter with a possible value of true or false indicating the condition of the listed items.

F_USED_VERY_GOOD

Boolean parameter with a possible value of true or false indicating the condition of the listed items.

F_USED_ACCEPTABLE

Boolean parameter with a possible value of true or false indicating the condition of the listed items.

ZIP Code Targeting

Sample Response

{
	"item": {
		"name": "Razer Blade 15 Gaming Laptop 2019: Intel Core i7-9750H 6 Core, NVIDIA GeForce RTX 2060, 15.6\" FHD 1080p 144Hz, 16GB RAM, 512GB SSD, CNC Aluminum, Chroma RGB Lighting, Thunderbolt 3",
		"subtitle": "",
		"author": "",
		"brand": "Razer",
		"product_information": {
			"brand": "Razer",
			"series": "Blade 15",
			"screen_size": "15.6 Inches",
			"color": "Classic Black",
			"hard_disk_size": "512 GB",
			"cpu_model": "Core i7 Family",
			"ram_memory_installed_size": "16 GB",
			"operating_system": "Windows 10",
			"card_description": "Dedicated",
			"graphics_coprocessor": "NVIDIA GeForce RTX 2060"
		},
		"listings_link": "https://www.amazon.com/gp/aod/ajax/ref=tmm_pap_used_aod_0?filters=%257B%2522all%2522%253Atrue%252C%2522usedLikeNew%2522%253Atrue%252C%2522usedVeryGood%2522%253Atrue%252C%2522usedGood%2522%253Atrue%257D&condition=used&asin=B07R1P4DQG&pc=dp;",
		"image": "",
		"average_rating": 4.4,
		"total_reviews": 697
	},
	"listings": [
		{
			"price_with_currency": "",
			"price": null,
			"shipping_price": null,
			"has_prime_shipping": false,
			"ships_from": "Amazon.com",
			"sold_by": "Amazon.com",
			"fullfilled_by_amazon": false
		}
	],
	"pagination": []
}
PreviousAmazon Search API: Structured Data in RubyNextAmazon Reviews API: Structured Data in Ruby

Last updated 9 months ago

Was this helpful?

To find out mote about ZIP Code targeting, please follow link

this