Quantcast
Channel: HTML & Web Page Design – Ask Dave Taylor
Viewing all articles
Browse latest Browse all 46

Embed an Amazon Search Link on my Web page?

$
0
0
reverse engineer amazon search url link

It’s long been accepted by the online community that if you’re shopping for just about anything at all, from books to socks, cat pajamas to car tire pressure gauges, your first stop needs to be Amazon.com. I know I shop there all the time and it’s a rare week where I don’t get something or other, even if it’s just sitting in the “shopping cart” waiting for enough products to make shipping worthwhile. As a consequence, I kind of figure at this point that most everyone knows how to do a product search on Amazon too, but… what you ask is pretty interesting because it’s very doable, so that instead of saying “cat pajamas” as I did earlier, I can actually link to a search for cat pajamas on Amazon!

So how did I do that? Let’s go through the steps. The key concept, as with all of these sort of reverse-engineering solutions, is to actually do the search, then look closely at the URL of the resultant search results page.

To start, if I go to Amazon and type in “cat pajamas”, here are all the suggested searches listed:

amazon cat pajamas suggested search

I have to admit to a bit of curiosity about “cat pajamas for cats only”. Do cats even wear pajamas? Not in my house, at least… 🙂

Anyway, do the search and you’ll get a remarkable number of search results on the page, along with lots of sponsored listings too. Apparently this is a more popular search than you may initially have realized!

amazon search result: cat pajamas

All interesting, but it’s the URL bar that you want to check. A closer look reveals this seeming gobbledygook:

amazon search results url

I admit, some of this is pretty cryptic (what’s nb_sb_noss_1, for example) but the good news is that you don’t have to understand every element to be able to disassemble and reassemble a search results URL. The critical part is at the end: field-keywords=cat+pajamas.

Now, let’s test this by changing the search to “boys soccer shorts”. The result is:

https://www.amazon.com/s/ref=nb_sb_noss_1?url=search-alias%3Daps&field-keywords=boys+soccer+shorts

Does it work? Click it and find out!

So it’s ugly, but it’s usable. To have the so-called anchor text be something more attractive, you can hand tweak the HTML if you want, or, if i you’re in a tool like WordPress, simply type in the words you want to have shown and clickable, then click on the anchor link tool and paste in the URL.

Like this: Buy Boys Soccer Shorts at Amazon.com.

That’s it. Now you can just change the field-keywords value (make sure you use “+” instead of spaces between words!) and go wild. You can have dozens – heck, hundreds! – of searches embedded on a Web page now. Good luck.

Pro Tip: I’ve been writing about basic HTML and Web coding for a while. Please check out all my HTML help while you’re here!

The post Embed an Amazon Search Link on my Web page? originally appeared on Ask Dave Taylor.


Viewing all articles
Browse latest Browse all 46

Trending Articles