0

Amazon Prime Video has some categories you can browse by price (e.g. "$4.99 or less", "$9.99 or less"). Sometimes when searching Amazon at large, you can specify both a minimum and maximum price. Is it possible to filter Prime Videos by arbitrary prices, so you could (e.g.) view videos from $5.99 through $6.99, or videos costing exactly $7.99, either by modifying the URL or through Amazon's own pages?

1 Answer 1

0

It's possible by editing the URL, though requires a few steps.

Amazon, not being satisfied with web standards, encodes some query parameters in a "queryToken" query string parameter. It's base-64 and then percent encoded; decoding using your favorite method, you'll get something like:

{
  "type":"query","nav":true,"pi":"default","sec":"center","stype":"search",
  "qry":"node=20458200011&field-ways_to_watch=12007867011&p_n_entity_type=14069184011&adult-product=0&bbn=20458200011&field-is_prime_benefit=0&field-price=-999&field-consumption_type=Purchase&search-alias=instant-video&qs-av_request_type=4&qs-is-prime-customer=2",
  "rt":"leqAU4smr",
  "txt":"$9.99 or less movie deals",
  "offset":0,"npsi":0,
  "oreq":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXXXXXXXXXXXXXXX",
  "strid":"X:XXXXXXXXXXXXXX##XXXXXXXXXXXXXXXXXXXXXXXX",
  "oreqk":"WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFg=",
  "oreqkv":1
}

(Whitespace added for readability; some values anonymized.)

The unencoded queryToken uses JSON. Within it, the "qry" property is a query string. So, you have a query string containing base-64 encoded JSON, containing a query string. That's innovation.

The "field-price" within "qry" is a price range in cents. A missing bound means don't check that bound, so "-999" means "<= $9.99" (rather than "negative 999¢").

Prime Video browse view

Simple edit the bounds, then re-encode & replace queryToken in the URL, and you should have the results. You can also change the "txt" property to change the heading (so you can see what the results actually are). For example, changing "field-price" to "599-599" and "txt" to "$5.99-$6.99", the unencoded queryToken becomes:

{
  "type":"query","nav":true,"pi":"default","sec":"center","stype":"search",
  "qry":"node=20458200011&field-ways_to_watch=12007867011&p_n_entity_type=14069184011&adult-product=0&bbn=20458200011&field-is_prime_benefit=0&field-price=599-699&field-consumption_type=Purchase&search-alias=instant-video&qs-av_request_type=4&qs-is-prime-customer=2",
  "rt":"leqAU4smr",
  "txt":"$5.99-$6.99",
  "offset":0,"npsi":0,
  "oreq":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXXXXXXXXXXXXXXX",
  "strid":"X:XXXXXXXXXXXXXX##XXXXXXXXXXXXXXXXXXXXXXXX",
  "oreqk":"WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFg=",
  "oreqkv":1
}

You should be able to leave the whitespace, or you can strip it before base-64 encoding. You can also skip percent-encoding, as the only characters that might be encoded are trailing "=", and these are perfectly valid in a query string parameter value (only in a parameter name would they need to be encoded).

Amazon Search Results view

Updating "queryToken" gives you the results in a Prime Video browsing view, with movies displayed in a grid. As an alternative, you can extract the node ID (check the "node" or "bbn" parameters of "qry") and use it to view the results as generic Amazon results. Instead of a "field-price" query parameter, use the price range query parameter for searches in general. As of this post, it's the parameter named "rh", with a prefix of 'p_36:' (possibly percent encoded) before the range value (rh=p_36:lo-hi). Amazon might change this, in which case you'll need to run a search that include price range as a filter option, and then check the resulting URL for the price range.

To create the URL, use a path of "/s" (for search?) or "/b" (for browse?), and append the node ID and price range query parameters. The values may be percent-encoded, but it's not necessary. For example:

Other domains, such as "www.amazon.com", may be used instead of "smile.amazon.com", but I like to default to the site for the donation program.

Caveats

This will filter within the given product node (which will be videos below a certain price that Amazon has chosen to advertise). If the price range extends beyond what's in the node, any videos matching the price range but not in the node won't be included (essentially, the price range will be clipped to what's in the node).

The filter only works on some nodes. When I tried with the "Prime Video" node, it didn't seem to filter based on price. It seemed to work with the "$X.XX or less" nodes.

The node IDs used above are current for the "$9.99 or less" and "$7.99 or less" pages. They may get updated; get the current node IDs to be sure you get the newest results.

Amazon's future innovations may (and likely will) break this technique, possibly leaving no way to reproduce the functionality.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.