Code Examples
Use cURL, PHP and JavaScript to call ALEFBA APIs.
cURL — Public Catalog
curl "https://alefba.eu/api/catalog?page=1&limit=3"
PHP — Public Catalog
<?php
$url = 'https://alefba.eu/api/catalog?page=1&limit=3';
$response = file_get_contents($url);
if ($response === false) {
throw new RuntimeException('Unable to reach ALEFBA API.');
}
$data = json_decode($response, true, 512, JSON_THROW_ON_ERROR);
print_r($data);
JavaScript — Public Catalog
const response = await fetch(
'https://alefba.eu/api/catalog?page=1&limit=3'
);
if (!response.ok) {
throw new Error(`ALEFBA API error: ${response.status}`);
}
const data = await response.json();
console.log(data);