Skip to main content
placeanalyzerAPI ReferenceGuías

Generate Market Reports

Reports complement your appraisals with

contextual data about the area. Imagine being able to show your clients not only the property value, but also the demographic, commercial, and regulatory analysis of the area.

The Anatomy of a Report

A report is composed of independent sections. Each section has its own endpoint and provides specific data:

1. Population Data

Get demographic and socioeconomic information about the area.

To obtain population data, check the documentation in the API Reference: Statistical data and charts.

Usage example:

curl -X GET "https://api.place-api.com/report/v1/population?lat=-34.6037&lng=-58.3816" \
-H "X-API-KEY: your_api_key_here"

Response:

{
  "location": {
    "lat": -34.6037,
    "lng": -58.3816,
    "zoneName": "Palermo"
  },
  "population": {
    "total": 256788,
    "density": 12500,
    "ageDistribution": {
      "0-14": 15.2,
      "15-29": 22.1,
      "30-44": 25.8,
      "45-59": 20.3,
      "60+": 16.6
    },
    "socioeconomicLevel": {
      "A": 12.5,
      "B": 28.7,
      "C": 45.2,
      "D": 13.6
    }
  }
}

How to use this data?

  • 📊 Age charts: Create age distribution histograms
  • 💰 Socioeconomic level: Show area composition
  • 🏠 Population density: Contextualize the environment

2. Commercial Analysis

Discover what businesses and services are near the property.

To obtain commercial analysis for charts, check the documentation in the API Reference: Statistical data and charts.

Usage example:

curl -X GET "https://api.place-api.com/report/v1/commerce-graphic?lat=-34.6037&lng=-58.3816" \
-H "X-API-KEY: your_api_key_here"

Response:

{
  "location": {
    "lat": -34.6037,
    "lng": -58.3816,
    "zoneName": "Palermo"
  },
  "commerceAnalysis": {
    "totalCommerces": 1250,
    "byCategory": {
      "RESTAURANTS": 25.2,
      "SHOPS": 18.8,
      "SERVICES": 15.4,
      "HEALTH": 12.1,
      "EDUCATION": 8.9,
      "ENTERTAINMENT": 7.3,
      "TRANSPORT": 6.2,
      "FINANCIAL": 3.8,
      "OTHER": 2.3
    },
    "topCommerces": [
      {
        "name": "Starbucks Palermo",
        "category": "RESTAURANTS",
        "rating": 4.2,
        "distance": 0.3
      },
      {
        "name": "Banco Galicia",
        "category": "FINANCIAL",
        "rating": 3.8,
        "distance": 0.5
      }
    ]
  }
}

Pie Chart with this data:

// Data for pie chart
const commerceData = {
  labels: ['Restaurants', 'Shops', 'Services', 'Health', 'Education'],
  datasets: [{
    data: [25.2, 18.8, 15.4, 12.1, 8.9],
    backgroundColor: ['#FF6384', '#36A2EB', '#FFCE56', '#4BC0C0', '#9966FF']
  }]
};

3. Regulatory Plan

Urban planning and regulatory information of the area.

To obtain regulatory plan information, check the documentation in the API Reference: Viewer.

Usage example:

curl -X GET "https://api.place-api.com/report/v1/regulatory-plan?lat=-34.6037&lng=-58.3816" \
-H "X-API-KEY: your_api_key_here"

Response:

{
  "location": {
    "lat": -34.6037,
    "lng": -58.3816,
    "zoneName": "Palermo"
  },
  "regulatoryInfo": {
    "zoning": "R2B1",
    "zoningDescription": "Residential with ground floor commerce",
    "allowedUses": [
      "RESIDENTIAL",
      "COMMERCIAL_GROUND_FLOOR",
      "OFFICES",
      "SERVICES"
    ],
    "buildingRestrictions": {
      "maxHeight": 25,
      "maxFAR": 3.5,
      "minFrontSetback": 3,
      "maxLotCoverage": 0.7
    },
    "specialDistricts": [
      "HISTORIC_PRESERVATION"
    ]
  }
}

4. Analysis by Commercial Categories

Details commerce by specific categories.

To obtain businesses filtered by category, check the documentation in the API Reference: Commerce.

Example - Restaurants only:

curl -X GET "https://api.place-api.com/report/v1/commerces-by-category?lat=-34.6037&lng=-58.3816&category=RESTAURANTS" \
-H "X-API-KEY: your_api_key_here"

5. Analysis by Sectors

Commerce organized by geographic zones.

To obtain commercial analysis by geographic sectors, check the documentation in the API Reference: Commerce.

Complete Example: Comprehensive Report

Here's an example that combines multiple endpoints to create a complete report:

async function generateCompleteReport(lat, lng, apiKey) {
  console.log('📊 Generating complete report...');

  try {
    // Execute all queries in parallel
    const [population, commerce, regulatory] = await Promise.all([
      fetch(`{REPORT_API_URL}/population?lat=${lat}&lng=${lng}`, {
        headers: { 'X-API-KEY': apiKey }
      }),
      fetch(`{REPORT_API_URL}/commerce-graphic?lat=${lat}&lng=${lng}`, {
        headers: { 'X-API-KEY': apiKey }
      }),
      fetch(`{REPORT_API_URL}/regulatory-plan?lat=${lat}&lng=${lng}`, {
        headers: { 'X-API-KEY': apiKey }
      })
    ]);

    const [populationData, commerceData, regulatoryData] = await Promise.all([
      population.json(),
      commerce.json(),
      regulatory.json()
    ]);

    // Combine all data
    const report = {
      location: populationData.location,
      sections: {
        population: populationData.population,
        commerce: commerceData.commerceAnalysis,
        regulatory: regulatoryData.regulatoryInfo
      }
    };

    console.log('✅ Report generated successfully');
    return report;

  } catch (error) {
    console.error('❌ Error generating report:', error);
    throw error;
  }
}

// Usage example
generateCompleteReport(-34.6037, -58.3816, 'your_api_key_here')
  .then(report => {
    console.log('Zone:', report.location.zoneName);
    console.log('Total population:', report.sections.population.total);
    console.log('Total businesses:', report.sections.commerce.totalCommerces);
    console.log('Zoning:', report.sections.regulatory.zoning);
  });

Best Practices for Reports

1. Smart Cache

// Cache reports for 24 hours
const CACHE_TTL = 24 * 60 * 60 * 1000; // 24 hours in ms

class ReportCache {
  constructor() {
    this.cache = new Map();
  }

  async getReport(lat, lng) {
    const key = `${lat},${lng}`;
    const cached = this.cache.get(key);

    if (cached && Date.now() - cached.timestamp < CACHE_TTL) {
      return cached.data;
    }

    const report = await generateCompleteReport(lat, lng, API_KEY);
    this.cache.set(key, { data: report, timestamp: Date.now() });

    return report;
  }
}

2. Error Handling by Section

async function generateReportWithFallbacks(lat, lng, apiKey) {
  const sections = {};

  // Try to get each section independently
  try {
    const populationResponse = await fetch(`.../population?lat=${lat}&lng=${lng}`, {
      headers: { 'X-API-KEY': apiKey }
    });
    sections.population = await populationResponse.json();
  } catch (error) {
    sections.population = { error: 'Not available' };
  }

  // Repeat for other sections...
  return sections;
}

3. Scheduled Reports

For properties you query frequently:

// Generate report and save to database
async function scheduleReport(propertyId, lat, lng) {
  const report = await generateCompleteReport(lat, lng, API_KEY);

  await saveToDatabase(propertyId, {
    report: report,
    generatedAt: new Date(),
    expiresAt: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000) // 7 days
  });

  return report;
}

Conclusion

Reports transform a simple appraisal into a comprehensive analysis that includes:

  • 👥 Demographic context of the area
  • 🏪 Complete commercial analysis
  • 📋 Regulatory information for development
  • 🏠 Comparison with nearby properties

Next steps:

Need help with a specific endpoint? Check the complete API reference.