Hello n8n community,
I am having a persistent issue where the Keepa API /query (Product Finder) endpoint ignores my selection parameters when called from my n8n environment. Regardless of the filters I apply, it consistently returns over 900 million results (the entire database).
My Environment:
-
n8n Version: 2.1.5 (Self-hosted via Docker)
-
Constraint: Modern libraries like
fetchoraxiosare unavailable. I am using the legacythis.helpers.requestmethod.
What I have tried:
-
HTTP Request Node: Configured a POST request with the JSON body. Filters were ignored.
-
Code Node (JS): Used the following code for a simple “Top 100 products” test case to avoid any complexity.
Disguised Test Code:
JavaScript
const k = "YOUR_API_KEY"; // API Key Hidden
const payload = {
"domainId": 1,
"selection": {
"pagination": { "page": 0, "perPage": 50 },
"sort": [["current_SALES", "asc"]],
"filters": {
"rootCategory": 284507,
"current_SALES_gte": 1,
"current_SALES_lte": 100,
"productType": [0],
"csv_SALES": false
}
}
};
const options = {
method: 'POST',
uri: "https://api.keepa.com/query?key=" + k,
body: payload,
json: true
};
try {
const response = await this.helpers.request(options);
return [{ json: response }];
} catch (e) {
return [{ json: { error: true, message: e.message } }];
}
Observation:
-
The API call returns Status 200.
-
tokensConsumedis approximately 11, indicating a valid/querycall. -
However,
totalResultsalways shows 989,911,511.
It seems like the nested JSON object in the selection parameter isn’t being serialized in a way that the Keepa API recognizes when sent from n8n v2.1.5. Does anyone have experience with this specific serialization issue or a workaround for this legacy environment?
Thank you for your help!