Sign Up

Log In


By unogs
Updated 2 months ago
Popularity Score
Success Rate
MaFt3 years ago
Count and Items don't match?Getting expiry dates for US from and it says there are 102 in COUNT BUT the json only returns 100 in ITEMS. UK has 70 items and correctly shows 70.
unogs3 years ago
MaFt you truly are a rock star! Thanks for the great support, you are the best!
MaFt3 years ago
And for anyone who's curious...: $results = (object) array_merge((array) $response_1->body->ITEMS, (array) $response_2->body->ITEMS ......)
jakothan3 years ago
Thanks for the awesome support at this site! MaFt thumbs up! unogs thanks for testing! Great! Works like a charme now! ;)
jakothan3 years ago
should be in your inbox. :) Thank you!! :)
MaFt3 years ago
Do you want to email me your code and I can have a look at the whole lot? Do remove your mashape key and any identifiable info etc though. mail AT maft DOT co DOT uk
jakothan3 years ago
$reponse_1 and _2 starting with the correct titles as unogs wrote above. Every page has 100 titles. That seems to be correct. I'm using a string to get each title. Like this: <pre>do { foreach ($datareq->body->ITEMS as $ITEM) { .... } } while ($i <= $anzahl);</pre>
MaFt3 years ago
Jakothan - difficult to say without seeing the whole code. Are you converting the json into an array for parsing? when you do an array dump for $response_1 and $response_2 are you getting page one and page 2 data being shown?
jakothan3 years ago
Hi MaFt, thanks for your inspiration. :) I have 2 requests now, every request has the correct results. But when I merge them, only the last 100 results will be shown - so as I wrote above. I've merged them on this way: <pre>$results1 = (object) array_merge((array) $response_1, (array) $response_2);</pre> Have you an idea? It's only a hobby for me, I'm not a "Professional Coder" ... :/
MaFt3 years ago
Create a new array. Put each result from page 1 into an array. Use the ITEMS divided by 100 to see how many pages you need. Parse the next pages (if needed) and ADD those to the existing array. THEN do you work with each item in the array.
jakothan3 years ago
Hmm, when I merge the 3 requests, I have 3 times the request header in my datafile. Maybe that's the problem why the results are wrong. And I still have no plan how I can fix that. :( Hope, there are never more than 100 titles on the "Expiring List" in the future. :D
jakothan3 years ago
ok, I'll check this. ;) thank you.
unogs3 years ago
Looks like the issue is on your side I get the appropriate results when I run each one of those, you can test this on the Documents page of of the mashape website. what I'm getting: p=1 : first result: Tai Chi Zero p=2: first result: Prince Avalanche p=3: first result: The Congress p=4: first result: Herr Lehmann
jakothan3 years ago
Sure! request 1 <pre></pre> request 2 <pre></pre> request 3 <pre></pre>
unogs3 years ago
can you provide the exact urls you are using for each request?
jakothan3 years ago
First: "The Congress" and Last: "Hick" with 3 requests, merged to one.
unogs3 years ago
I just tried it and I'm seeing the correct responses. what is the first and last title showing up for each of your pages?
jakothan3 years ago
I've tried this... req1 = ...p=1 req2 = ...p=2 req3 = ...p=3 then I've merged req1,req2 and req3 to 1 object, but only the last 100 results will be shown. :(
unogs3 years ago
There is no way to fetch all titles... You need to handle the page number increments in your plugin e.g. p=1 gives you 1-100 p=2 gives you 101-200 etc
jakothan3 years ago
Hey, I'm using the request with pagenumber = 1 <pre></pre> in WordPress Plugin that I wrote by myself. So in the past the number 1 was "enough", but now we have over 400 titles expiring in germany. Is there a way to fetch all titles? Or something like a "auto increment" for pagenumbers?
MaFt3 years ago
Ah, good old user error :D Cheers
unogs3 years ago
Results on the API come in sets of 100, you will need to increment the page variable by 1 to see the other 2 results. e.g.
Hi Developer, feel free to post your answer:
Log inSign up

Install SDK for NodeJS


To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

.header("X-RapidAPI-Host", "undefined")
.header("X-RapidAPI-Key", "undefined")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication

Sign up for free

to test this endpoint

Join the world’s largest API marketplace with over half a million developers and thousands of APIs.
Testfrom the browser
Connectusing code snippets
Managefrom one dashboard