Skip to main content
URL Encoding

How to encode inputs when making an API request

Raunaq Singh avatar
Written by Raunaq Singh
Updated over a month ago

🧐 Why is encoding necessary

We need you to do this so that our server doesn't confuse your input that defines the source which needs to be scraped for an API query parameter we need.

Follow the instructions below to encode the inputs πŸ‘‡πŸΌ

πŸ”— For URL queries

The value of the query parameter url when using any of the product or reviews APIs should be encoded.
​
Here's what encoding looks like:
​
Before: https://www.amazon.com/Black-Decker-BPWM09W-Portable-Washer/dp/B0799Q45TT

After: https%3A%2F%2Fwww.amazon.com%2FBlack-Decker-BPWM09W-Portable-Washer%2Fdp%2FB0799Q45TT

This can be done with the urlencode if you are using Python, or using any popular URL library for the pfavoriteg language you use. If you're not sure how you need to do this, you will probably get help by asking here.

πŸ”Ž For Search queries

If you're using any of the search APIs we support, the input you use to make a query via keyword is the query parameter search.

For cases where the search keyword is a single word, you can pass it just as it is as a string. And for cases in which there are multiple words you have 2 options:
​
1️⃣ Either replace any whitespace with a + symbol for e.g. "white+sofa"
​
OR
​
2️⃣ Encode the search term for e.g. white%20sofa

Did this answer your question?