Skip to content

Instantly share code, notes, and snippets.

@odrianoaliveira
Last active June 13, 2026 20:39
Show Gist options
  • Select an option

  • Save odrianoaliveira/090ac57a0502604f672c03e87782966e to your computer and use it in GitHub Desktop.

Select an option

Save odrianoaliveira/090ac57a0502604f672c03e87782966e to your computer and use it in GitHub Desktop.
How-to use the completion.amazon.com API
  • URL: https://completion.amazon.com/api/2017/
  • Resource: suggestions
  • Paramters:
    • session-id: 133-2190809-5709766
    • customer-id: A1CNYR04B8CZOZ
    • request-id: NTH41W0H5GYC8N00NVCS
    • page-type: Gateway
    • lop=en_US
    • site-variant=desktop
    • client-info=amazon-search-ui
    • mid=ATVPDKIKX0DER
    • alias=aps
    • b2b=0
    • fresh=0
    • ks=69
    • prefix=iphone
    • event=onKeyPress
    • limit=11
    • fb=1
    • suggestion-type=KEYWORD
    • _=1551464006702

A minimum working request: https://completion.amazon.com/api/2017/suggestions?mid=ATVPDKIKX0DER&alias=aps&prefix=iphone

https://completion.amazon.com/api/2017/suggestions?session-id=133-2190809-5709766&customer-id=A1CNYR04B8CZOZ&request-id=NTH41W0H5GYC8N00NVCS&page-type=Gateway&lop=en_US&site-variant=desktop&client-info=amazon-search-ui&mid=ATVPDKIKX0DER&alias=aps&b2b=0&fresh=0&ks=69&prefix=iphone&event=onKeyPress&limit=11&fb=1&suggestion-type=KEYWORD&_=1551464006702

@therubioftw

Copy link
Copy Markdown

Hi @odrianoaliveira!
Thanks for this, I looked everywhere for a list of potential parameters. Did you ever figure out what they all do?
Some of them make sense, but others are pretty mysterious - but regardless, I would love to know if you made any kind of headway into values for each of them...

BTW, do you know what this type of request brings back? It seems a lot more basic, I just don't understand exactly what I'm getting.
https://completion.amazon.com/search/complete?search-alias=aps&client=amazon-search-ui&mkt=1&q=iphone%206

@Guido3000

Copy link
Copy Markdown

@therubioftw
Some information:

  • session-id = your current user session id
  • customer-id = your customer id, if logged in
  • lop = maybe "language of page" --> changes with user choosen language settings of amazon website
  • mid = marketplace ID --> If the parameter is omitted, the following message appears "Invalid Marketplace ID". Each marketplace has its own ID. E.g US = ATVPDKIKX0DER
  • b2b = seems to be value "1" if you are logged in with a bussines account and "0" with non business.
  • limit = max. number of results

And some futher params:

  • plain-mid
  • last-prefix
  • version

@kegould

kegould commented Jan 11, 2023

Copy link
Copy Markdown

Hi! Do you have any insight on how to get this API call to work with the Amazon UK domain (i.e. amazon.co.uk)?

@TalhaQuddoos

Copy link
Copy Markdown

@kegould I guess you can do that by setting the value of mid parameter as A1F83G8C2ARO7P.

@kegould

kegould commented Apr 11, 2023

Copy link
Copy Markdown

I changed the value of lop to EN_GB and it worked! Thank you though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment