Question by sh4kesbeer · Mar 22 at 02:35 PM · browse apibrowsemarketplacesmarketplace
X-EBAY-C-MARKETPLACE-ID is ignored
Hi, I try to search the german ebay but I will always get US results no matter how I set X-EBAY-C-MARKETPLACE-ID. Is this a known issue? A couple months earlier a guy seems to have had the same issue (see this forum) but there was no real solution. Is this a known bug and is there any way to make this work?
Answer by sh4kesbeer · Mar 24 at 03:10 AM
Hi, thanks for your reply.
I do e.g. in the following way:
let queryURL = "https://api.ebay.com/buy/browse/v1/item_summary/search?" +
"q=abitur"
let options = {
headers: {
"Authorization": "Bearer " + auth_token,
"X-EBAY-C-MARKETPLACE-ID": "EBAY_DE",
"Accept-Language": "en-US",
"Content-Type": "application/json",
"Accept": "application/json",
"Accept-Charset": "utf-8",
"Content-Language": "en-US"
}
}
let itemReq = https.get(queryURL, options, (res) => {
var data = null
res.on("data", part => {
data = data === null ? part : data + part
})
res.on("end", () => {
let response = JSON.parse(data)
resolve(response)
})
})
console.log(itemReq)
It also does not seem to matter what accept-language or content-language I set...
People who like this
Answer by helios825 · Mar 25 at 11:39 PM
Hmmm... I'm not sure about why, but I wonder if all of those HTML "quot" entities might be getting in the way.
For example, you may need to have exactly this syntax: X-EBAY-C-MARKETPLACE-ID: EBAY_DE
Notice above the colon, then space, then EBAY_DE .
Perhaps also try this (without any "quot"s getting in the way): X-EBAY-C-MARKETPLACE-ID = EBAY_DE
People who like this
Answer by sh4kesbeer · Mar 26 at 01:08 AM
Thanks for your reply! As I stated in the comment (which seems to have disappeared mysteriously...) in the code there are no "quot" things these were inserted by this forum to escape the ". The headers are handled by the nodejs api by giving key-values. After all the Authorization part with the bearer token is working (if I remove it the server will complain) so I guess the handling of the headers is correct. I will attach a screenshot of how this looks unescaped in my code as I am a bit frustrated right now...
People who like this
Your answer
