Ready-to-use code examples for common patterns
Get historical data for a specific dataset
// Fetch GDP growth data for Greece
const response = await fetch(
'/api/analytics/timeseries/gdp_growth?country=GR'
);
const data = await response.json();
if (data.success) {
console.log(data.data); // Array of time series points
}Evaluate rental pricing
const response = await fetch('/api/fairrent/calculate-score', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
rent: 800,
size: 75,
country: 'GR',
quality: 7,
rental_type: 'apartment'
})
});
const result = await response.json();
console.log(result.score); // 78 (0-100 scale)