I am using a Rest API to get data from a website and I would like to use that data in my webshop. I have never worked with API's before.
I now have the following code:
<?php
$url = 'https://api.floraathome.nl/v1/products/get?apitoken=[MY_API_TOKEN]&type=json';
$json = file_get_contents($url);
$retVal = json_decode($json, TRUE);
for ($x = 0; $x < count($retVal); $x++) {
echo $retVal['data'][$x]['dutchname']."<br>";
echo $retVal['data'][$x]['purchaseprice']."<br>";
echo $retVal['data'][$x]['promotionaltext']."<br><br>";
}
My problem is that it only shows the first 2 products, but I have 9 products selected. If I print $retVal, it does output all 9 products.