Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
get the product matches
require 'net/http'
require 'uri'
require 'json'
uri = URI.parse("https://sellercentral.amazon.com/fba/profitabilitycalculator/productmatches?searchKey=B000I1TJW6&language=en_US&profitcalcToken=taco")
request = Net::HTTP::Get.new(uri)
request["Authority"] = "sellercentral.amazon.com"
request["Upgrade-Insecure-Requests"] = "1"
request["User-Agent"] = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36"
request["Accept"] = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3"
request["Accept-Language"] = "en-US,en;q=0.9"
req_options = {
use_ssl: uri.scheme == "https",
}
response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
http.request(request)
end
data = JSON.parse(response.body, symbolize_names: true).dig(:data).first
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.