Skip to main content

API Quick Reference

Ready-to-use code snippets for the 10 easiest government APIs to integrate into your hackathon project.
External Data Sources - Test Before BuildingThese UAE government API examples use third-party services outside the Open Finance platform:Critical Reminders:
  • Test endpoints immediately - API availability may vary during the hackathon
  • Implement fallbacks - Always have backup plans if APIs are unavailable
  • No technical support - These are external services not covered by hackathon support
  • Data quality varies - Freshness and accuracy differ by source
  • Optional enhancement - Not required; you can build excellent projects with Open Finance APIs alone
Best Practice: Within the first few hours of the hackathon, test all external APIs you plan to use. If unavailable or unreliable, pivot to alternative features or use sample/cached data.
⚡ Quick Start: All examples are tested and ready to copy-paste. Most require no authentication for public data.

1. Dubai Pulse Universal API

The easiest starting point - 3000+ datasets with consistent API structure
// Dubai Pulse API Client
class DubaiPulseAPI {
  constructor() {
    this.baseURL = 'https://www.dubaipulse.gov.ae/api';
  }

  async fetchDataset(datasetId, params = {}) {
    const url = new URL(`${this.baseURL}/dataset/${datasetId}`);
    Object.entries(params).forEach(([key, value]) => {
      url.searchParams.append(key, value);
    });

    const response = await fetch(url, {
      headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json'
      }
    });

    if (!response.ok) {
      throw new Error(`API Error: ${response.status}`);
    }

    return response.json();
  }
}

// Usage examples
const api = new DubaiPulseAPI();

// Get DED business licenses
const businesses = await api.fetchDataset('ded-business-licences', {
  area: 'Dubai Marina',
  sector: 'Technology',
  status: 'Active',
  limit: 100
});

// Get DLD property transactions
const properties = await api.fetchDataset('dld-real-estate-transactions', {
  property_type: 'Apartment',
  year: 2024,
  area: 'Downtown Dubai'
});

// Get RTA metro ridership
const ridership = await api.fetchDataset('rta-metro-ridership', {
  station: 'Burj Khalifa/Dubai Mall',
  month: '2024-01'
});

2. DLD Property Transactions

Real estate data with prices, areas, and property details
// DLD Property Data Fetcher
async function getPropertyData(area, propertyType = 'all') {
  const endpoint = 'https://www.dubaipulse.gov.ae/api/dataset/dld-real-estate-transactions';

  const params = new URLSearchParams({
    area: area,
    property_type: propertyType,
    year: new Date().getFullYear(),
    limit: 1000
  });

  try {
    const response = await fetch(`${endpoint}?${params}`);
    const data = await response.json();

    // Process and analyze the data
    const analysis = {
      totalTransactions: data.length,
      averagePrice: calculateAverage(data, 'price'),
      pricePerSqFt: calculateAverage(data, 'price_per_sqft'),
      topProjects: getTopProjects(data, 5),
      priceRange: {
        min: Math.min(...data.map(d => d.price)),
        max: Math.max(...data.map(d => d.price))
      },
      monthlyTrend: groupByMonth(data)
    };

    return { raw: data, analysis };
  } catch (error) {
    console.error('Error fetching property data:', error);
    return null;
  }
}

// Helper functions
function calculateAverage(data, field) {
  const sum = data.reduce((acc, item) => acc + (item[field] || 0), 0);
  return sum / data.length;
}

function getTopProjects(data, limit) {
  const projects = {};
  data.forEach(item => {
    projects[item.project] = (projects[item.project] || 0) + 1;
  });

  return Object.entries(projects)
    .sort((a, b) => b[1] - a[1])
    .slice(0, limit)
    .map(([name, count]) => ({ name, count }));
}

function groupByMonth(data) {
  const monthly = {};
  data.forEach(item => {
    const month = item.date.substring(0, 7); // YYYY-MM
    if (!monthly[month]) {
      monthly[month] = { count: 0, total: 0 };
    }
    monthly[month].count++;
    monthly[month].total += item.price;
  });

  return Object.entries(monthly).map(([month, stats]) => ({
    month,
    transactions: stats.count,
    avgPrice: stats.total / stats.count
  }));
}

// Usage
const dubaiMarinaData = await getPropertyData('Dubai Marina', 'Apartment');
console.log(`Average price: AED ${dubaiMarinaData.analysis.averagePrice.toLocaleString()}`);
console.log(`Price per sq ft: AED ${dubaiMarinaData.analysis.pricePerSqFt}`);

3. DED Business Licenses

Complete business registration data for Dubai
// Business Data API
class BusinessDataAPI {
  async searchBusinesses(filters) {
    const endpoint = 'https://www.dubaipulse.gov.ae/api/dataset/ded-business-licences';

    const response = await fetch(`${endpoint}?${new URLSearchParams(filters)}`);
    const data = await response.json();

    return this.processBusinessData(data);
  }

  processBusinessData(data) {
    // Group by sector
    const bySector = data.reduce((acc, business) => {
      const sector = business.sector || 'Unknown';
      if (!acc[sector]) acc[sector] = [];
      acc[sector].push(business);
      return acc;
    }, {});

    // Group by area
    const byArea = data.reduce((acc, business) => {
      const area = business.area || 'Unknown';
      if (!acc[area]) acc[area] = 0;
      acc[area]++;
      return acc;
    }, {});

    // Find top sub-sectors
    const subSectorCount = {};
    data.forEach(business => {
      const subSector = business.sub_sector || 'Unknown';
      subSectorCount[subSector] = (subSectorCount[subSector] || 0) + 1;
    });

    const topSubSectors = Object.entries(subSectorCount)
      .sort((a, b) => b[1] - a[1])
      .slice(0, 10)
      .map(([name, count]) => ({ name, count }));

    return {
      total: data.length,
      bySector,
      byArea,
      topSubSectors,
      raw: data
    };
  }

  async getCompetitors(sector, area) {
    return this.searchBusinesses({
      sector,
      area,
      status: 'Active',
      limit: 500
    });
  }

  async analyzeMark

etSaturation(sector, area) {
    const competitors = await this.getCompetitors(sector, area);

    // Estimate market size (simplified)
    const populationEstimate = 50000; // Per area estimate
    const businessesPerCapita = competitors.total / populationEstimate;

    return {
      competitorCount: competitors.total,
      saturationIndex: businessesPerCapita * 1000, // Per 1000 people
      topCompetitors: competitors.raw.slice(0, 10),
      subSectorBreakdown: competitors.topSubSectors,
      recommendation: this.getMarketRecommendation(businessesPerCapita)
    };
  }

  getMarketRecommendation(saturation) {
    if (saturation < 0.5) return 'Low competition - good opportunity';
    if (saturation < 1.5) return 'Moderate competition - differentiation needed';
    return 'High saturation - consider different area or niche';
  }
}

// Usage
const businessAPI = new BusinessDataAPI();

// Search for tech companies in DIFC
const techCompanies = await businessAPI.searchBusinesses({
  sector: 'Information and Communication',
  area: 'DIFC',
  status: 'Active'
});

// Analyze restaurant market in JBR
const marketAnalysis = await businessAPI.analyzeMarketSaturation(
  'Accommodation and Food Service',
  'JBR'
);

console.log(`Found ${techCompanies.total} tech companies`);
console.log(`Market saturation: ${marketAnalysis.saturationIndex.toFixed(2)} businesses per 1000 people`);
console.log(`Recommendation: ${marketAnalysis.recommendation}`);

4. RTA Transportation Data

Public transport, traffic, and mobility information
// RTA Data Integration
class RTADataService {
  constructor() {
    this.baseURL = 'https://www.dubaipulse.gov.ae/api/dataset';
  }

  async getMetroRidership(station, period = 'monthly') {
    const endpoint = `${this.baseURL}/rta-metro-ridership`;
    const params = new URLSearchParams({
      station: station,
      period: period,
      year: new Date().getFullYear()
    });

    const response = await fetch(`${endpoint}?${params}`);
    const data = await response.json();

    return this.processRidershipData(data);
  }

  async getTrafficFlow(road, timeOfDay) {
    const endpoint = `${this.baseURL}/rta-traffic-flow`;
    const params = new URLSearchParams({
      road: road,
      time: timeOfDay
    });

    const response = await fetch(`${endpoint}?${params}`);
    return response.json();
  }

  async calculateCommuteTime(origin, destination, mode = 'car') {
    // Simplified commute calculation
    const trafficData = await this.getTrafficFlow(
      'Sheikh Zayed Road',
      new Date().getHours()
    );

    const baseTime = this.getBaseTime(origin, destination, mode);
    const congestionFactor = trafficData.congestion_level || 1;

    return {
      estimatedTime: baseTime * congestionFactor,
      mode: mode,
      alternativeRoutes: await this.getAlternativeRoutes(origin, destination),
      publicTransport: await this.getPublicTransportOptions(origin, destination)
    };
  }

  async getPublicTransportOptions(origin, destination) {
    // Get metro stations near origin and destination
    const options = [];

    // Check metro availability
    const metroRoute = this.findMetroRoute(origin, destination);
    if (metroRoute) {
      options.push({
        type: 'metro',
        duration: metroRoute.duration,
        cost: metroRoute.cost,
        stations: metroRoute.stations
      });
    }

    // Check bus routes
    const busRoutes = await this.findBusRoutes(origin, destination);
    options.push(...busRoutes);

    return options;
  }

  processRidershipData(data) {
    // Calculate statistics
    const totalRiders = data.reduce((sum, d) => sum + d.ridership, 0);
    const avgDaily = totalRiders / data.length;

    // Peak hours analysis
    const peakHours = data
      .filter(d => d.hour >= 7 && d.hour <= 9 || d.hour >= 17 && d.hour <= 19)
      .reduce((sum, d) => sum + d.ridership, 0);

    const offPeakHours = totalRiders - peakHours;

    return {
      total: totalRiders,
      dailyAverage: avgDaily,
      peakHoursPercentage: (peakHours / totalRiders * 100).toFixed(1),
      busiestDay: this.findBusiestDay(data),
      trend: this.calculateTrend(data)
    };
  }

  findBusiestDay(data) {
    const byDay = {};
    data.forEach(d => {
      byDay[d.day] = (byDay[d.day] || 0) + d.ridership;
    });

    return Object.entries(byDay)
      .sort((a, b) => b[1] - a[1])[0];
  }

  calculateTrend(data) {
    // Simple trend calculation
    const firstHalf = data.slice(0, data.length / 2);
    const secondHalf = data.slice(data.length / 2);

    const firstAvg = firstHalf.reduce((sum, d) => sum + d.ridership, 0) / firstHalf.length;
    const secondAvg = secondHalf.reduce((sum, d) => sum + d.ridership, 0) / secondHalf.length;

    const change = ((secondAvg - firstAvg) / firstAvg * 100).toFixed(1);
    return {
      direction: change > 0 ? 'increasing' : 'decreasing',
      percentage: Math.abs(change)
    };
  }
}

// Usage
const rta = new RTADataService();

// Get metro ridership for Burj Khalifa station
const ridership = await rta.getMetroRidership('Burj Khalifa/Dubai Mall');
console.log(`Daily average: ${ridership.dailyAverage.toLocaleString()} riders`);
console.log(`Peak hours: ${ridership.peakHoursPercentage}% of traffic`);

// Calculate commute options
const commute = await rta.calculateCommuteTime(
  'Dubai Marina',
  'DIFC',
  'car'
);
console.log(`Estimated time: ${commute.estimatedTime} minutes`);
console.log(`Public transport options: ${commute.publicTransport.length}`);

5. Tourism & Visitor Statistics

Tourist arrivals, hotel occupancy, and tourism trends
// Tourism Data API
class TourismDataAPI {
  async getVisitorStats(period = 'monthly') {
    const endpoint = 'https://www.dubaipulse.gov.ae/api/dataset/det-visitor-statistics';
    const year = new Date().getFullYear();

    const response = await fetch(`${endpoint}?year=${year}&period=${period}`);
    const data = await response.json();

    return this.analyzeTourismData(data);
  }

  async getHotelOccupancy(area) {
    const endpoint = 'https://www.dubaipulse.gov.ae/api/dataset/det-hotel-occupancy';

    const params = new URLSearchParams({
      area: area,
      year: new Date().getFullYear()
    });

    const response = await fetch(`${endpoint}?${params}`);
    return response.json();
  }

  analyzeTourismData(data) {
    // Group by nationality
    const byNationality = {};
    data.forEach(visitor => {
      const country = visitor.nationality;
      byNationality[country] = (byNationality[country] || 0) + visitor.count;
    });

    // Top source markets
    const topMarkets = Object.entries(byNationality)
      .sort((a, b) => b[1] - a[1])
      .slice(0, 10)
      .map(([country, visitors]) => ({
        country,
        visitors,
        percentage: (visitors / data.reduce((sum, d) => sum + d.count, 0) * 100).toFixed(1)
      }));

    // Monthly trend
    const monthlyTrend = data.reduce((acc, item) => {
      const month = item.month;
      if (!acc[month]) acc[month] = 0;
      acc[month] += item.count;
      return acc;
    }, {});

    // Year-over-year growth
    const currentYear = data.filter(d => d.year === new Date().getFullYear());
    const previousYear = data.filter(d => d.year === new Date().getFullYear() - 1);

    const growth = previousYear.length > 0
      ? ((currentYear.length - previousYear.length) / previousYear.length * 100).toFixed(1)
      : 0;

    return {
      totalVisitors: data.reduce((sum, d) => sum + d.count, 0),
      topMarkets,
      monthlyTrend,
      yearOverYearGrowth: growth,
      averageStayDuration: this.calculateAverageStay(data),
      seasonality: this.analyzeSeasonality(monthlyTrend)
    };
  }

  calculateAverageStay(data) {
    const totalNights = data.reduce((sum, d) => sum + (d.nights || 0), 0);
    const totalVisitors = data.reduce((sum, d) => sum + d.count, 0);
    return (totalNights / totalVisitors).toFixed(1);
  }

  analyzeSeasonality(monthlyData) {
    const months = Object.values(monthlyData);
    const average = months.reduce((sum, val) => sum + val, 0) / months.length;

    const peak = Math.max(...months);
    const low = Math.min(...months);

    return {
      peakMonth: Object.keys(monthlyData).find(key => monthlyData[key] === peak),
      lowMonth: Object.keys(monthlyData).find(key => monthlyData[key] === low),
      variation: ((peak - low) / average * 100).toFixed(1)
    };
  }

  async predictDemand(business, location) {
    const [visitors, occupancy] = await Promise.all([
      this.getVisitorStats(),
      this.getHotelOccupancy(location)
    ]);

    // Simple demand prediction based on visitor trends
    const demandScore = this.calculateDemandScore(visitors, occupancy, business);

    return {
      currentDemand: demandScore,
      trend: visitors.yearOverYearGrowth > 0 ? 'growing' : 'declining',
      seasonality: visitors.seasonality,
      recommendation: this.getDemandRecommendation(demandScore, visitors.seasonality)
    };
  }

  calculateDemandScore(visitors, occupancy, businessType) {
    // Simplified scoring
    let score = 50; // Base score

    // Adjust based on visitor growth
    score += visitors.yearOverYearGrowth * 0.5;

    // Adjust based on occupancy
    if (occupancy.rate) {
      score += (occupancy.rate - 70) * 0.3; // 70% is baseline
    }

    // Business type adjustments
    if (businessType.includes('tourism') || businessType.includes('hotel')) {
      score *= 1.2;
    }

    return Math.min(100, Math.max(0, score));
  }

  getDemandRecommendation(score, seasonality) {
    const recommendations = [];

    if (score > 75) {
      recommendations.push('High demand - consider premium pricing');
    } else if (score < 40) {
      recommendations.push('Low demand - focus on promotions');
    }

    if (seasonality.variation > 30) {
      recommendations.push(`Prepare for seasonal variations - peak in ${seasonality.peakMonth}`);
    }

    return recommendations;
  }
}

// Usage
const tourismAPI = new TourismDataAPI();

// Get visitor statistics
const visitors = await tourismAPI.getVisitorStats();
console.log(`Total visitors: ${visitors.totalVisitors.toLocaleString()}`);
console.log(`YoY Growth: ${visitors.yearOverYearGrowth}%`);
console.log('Top markets:', visitors.topMarkets.slice(0, 3));

// Predict demand for a hotel business
const demand = await tourismAPI.predictDemand('Luxury Hotel', 'JBR');
console.log(`Demand score: ${demand.currentDemand}/100`);
console.log('Recommendations:', demand.recommendation);

6. Air Quality Data

Real-time air quality indices from monitoring stations
// Air Quality Monitor
class AirQualityService {
  async getCurrentAQI(location) {
    const endpoint = 'https://www.ead.gov.ae/api/airquality/current';

    const response = await fetch(`${endpoint}?location=${location}`);
    const data = await response.json();

    return {
      aqi: data.aqi,
      level: this.getAQILevel(data.aqi),
      pollutants: {
        pm25: data.pm25,
        pm10: data.pm10,
        no2: data.no2,
        o3: data.o3
      },
      healthAdvice: this.getHealthAdvice(data.aqi),
      timestamp: data.timestamp
    };
  }

  getAQILevel(aqi) {
    if (aqi <= 50) return 'Good';
    if (aqi <= 100) return 'Moderate';
    if (aqi <= 150) return 'Unhealthy for Sensitive Groups';
    if (aqi <= 200) return 'Unhealthy';
    if (aqi <= 300) return 'Very Unhealthy';
    return 'Hazardous';
  }

  getHealthAdvice(aqi) {
    if (aqi <= 50) return 'Air quality is satisfactory';
    if (aqi <= 100) return 'Acceptable for most, sensitive individuals may experience minor issues';
    if (aqi <= 150) return 'Sensitive groups should limit outdoor activities';
    return 'Everyone should limit outdoor activities';
  }
}

7. Energy Consumption (DEWA)

Electricity and water consumption statistics
// DEWA Energy Data
async function getEnergyData(sector, year) {
  const endpoint = 'https://www.dubaipulse.gov.ae/api/dataset/dewa-consumption';

  const params = new URLSearchParams({
    sector: sector, // 'residential', 'commercial', 'industrial'
    year: year,
    metric: 'monthly'
  });

  const response = await fetch(`${endpoint}?${params}`);
  const data = await response.json();

  // Calculate insights
  const totalConsumption = data.reduce((sum, month) => sum + month.consumption, 0);
  const avgMonthly = totalConsumption / data.length;
  const peakMonth = data.reduce((max, month) =>
    month.consumption > max.consumption ? month : max
  );

  return {
    total: totalConsumption,
    average: avgMonthly,
    peak: peakMonth,
    data: data,
    costEstimate: totalConsumption * 0.38 // AED per kWh average
  };
}

// Usage
const energyData = await getEnergyData('commercial', 2024);
console.log(`Annual consumption: ${energyData.total.toLocaleString()} kWh`);
console.log(`Estimated cost: AED ${energyData.costEstimate.toLocaleString()}`);

8. Weather Data

Current weather and forecasts
// Weather API Integration
class WeatherService {
  async getWeather(emirate) {
    const endpoint = 'https://api.ncm.ae/weather/current';

    const response = await fetch(`${endpoint}?emirate=${emirate}`);
    const weather = await response.json();

    return {
      temperature: weather.temp,
      humidity: weather.humidity,
      windSpeed: weather.wind_speed,
      visibility: weather.visibility,
      conditions: weather.conditions,
      forecast: await this.getForecast(emirate)
    };
  }

  async getForecast(emirate, days = 5) {
    const endpoint = 'https://api.ncm.ae/weather/forecast';

    const response = await fetch(`${endpoint}?emirate=${emirate}&days=${days}`);
    return response.json();
  }
}

9. Business Performance Indicators

Economic indicators and business statistics
// Economic Indicators API
async function getEconomicIndicators() {
  const endpoint = 'https://api.fcsc.gov.ae/indicators';

  const response = await fetch(endpoint);
  const data = await response.json();

  return {
    gdpGrowth: data.gdp_growth_rate,
    inflation: data.cpi_inflation,
    unemployment: data.unemployment_rate,
    fdi: data.foreign_direct_investment,
    exports: data.total_exports,
    imports: data.total_imports,
    populationGrowth: data.population_growth_rate
  };
}

// Sector performance
async function getSectorPerformance(sector) {
  const indicators = await getEconomicIndicators();
  const businesses = await searchBusinesses({ sector });

  return {
    sectorGrowth: calculateSectorGrowth(businesses),
    economicContext: indicators,
    marketSize: estimateMarketSize(businesses, indicators),
    opportunities: identifyOpportunities(businesses, indicators)
  };
}

10. School & Education Data

School information, ratings, and fees
// KHDA School Data
async function getSchoolData(curriculum, area) {
  const endpoint = 'https://www.dubaipulse.gov.ae/api/dataset/khda-schools';

  const params = new URLSearchParams({
    curriculum: curriculum, // 'British', 'American', 'IB', etc.
    area: area,
    fields: 'name,rating,fees,location'
  });

  const response = await fetch(`${endpoint}?${params}`);
  const schools = await response.json();

  // Analyze school data
  const analysis = {
    totalSchools: schools.length,
    avgFees: schools.reduce((sum, s) => sum + s.annual_fees, 0) / schools.length,
    byRating: groupByRating(schools),
    feeRange: {
      min: Math.min(...schools.map(s => s.annual_fees)),
      max: Math.max(...schools.map(s => s.annual_fees))
    }
  };

  return { schools, analysis };
}

function groupByRating(schools) {
  const ratings = {};
  schools.forEach(school => {
    const rating = school.rating || 'Not Rated';
    ratings[rating] = (ratings[rating] || 0) + 1;
  });
  return ratings;
}

🚀 Quick Integration Guide

Step 1: Test APIs in Browser

// Quick test - paste in browser console
fetch('https://www.dubaipulse.gov.ae/api/dataset/ded-business-licences?limit=5')
  .then(r => r.json())
  .then(data => console.log(data));

Step 2: Handle CORS Issues

// If CORS blocked, use a proxy
const PROXY = 'https://api.allorigins.win/get?url=';
const API_URL = 'https://www.dubaipulse.gov.ae/api/dataset/ded-business-licences';

fetch(PROXY + encodeURIComponent(API_URL))
  .then(r => r.json())
  .then(data => JSON.parse(data.contents));

Step 3: Implement Caching

// Simple caching wrapper
const cachedFetch = (() => {
  const cache = new Map();

  return async (url, ttl = 300000) => { // 5 min default
    if (cache.has(url)) {
      const { data, timestamp } = cache.get(url);
      if (Date.now() - timestamp < ttl) {
        return data;
      }
    }

    const data = await fetch(url).then(r => r.json());
    cache.set(url, { data, timestamp: Date.now() });
    return data;
  };
})();

Step 4: Error Handling

// Robust API wrapper
async function apiCall(url, retries = 3) {
  for (let i = 0; i < retries; i++) {
    try {
      const response = await fetch(url);
      if (!response.ok) throw new Error(`HTTP ${response.status}`);
      return await response.json();
    } catch (error) {
      if (i === retries - 1) throw error;
      await new Promise(r => setTimeout(r, 1000 * Math.pow(2, i)));
    }
  }
}

📦 npm Package

For quick integration, install our helper package:
# Coming soon - UAE Open Data SDK
npm install @uae-opendata/sdk
import { DubaiPulse, DLD, RTA, DET } from '@uae-opendata/sdk';

const dubaiPulse = new DubaiPulse();
const businesses = await dubaiPulse.getBusinesses({ sector: 'Technology' });
const properties = await dubaiPulse.getProperties({ area: 'Downtown' });

Next Steps

Pro Tip: Start with Dubai Pulse APIs - they’re the most consistent and well-documented. Once working, expand to other sources.