<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <!-- Core Meta Tags -->
    <title>API v1 Documentation - Global Market Reports</title>
    <meta name="description" content="Access comprehensive market research data via REST API. Authentication, rate limiting, and endpoint documentation.">
    <meta name="keywords" content="market research, market reports, industry analysis, business intelligence, market insights">
    <meta name="author" content="Global Market Reports">
    <meta name="robots" content="index, follow">
    <link rel="canonical" href="https://www.globalmarketreports.com/v1/">

    <!-- Open Graph / Facebook -->
    <meta property="og:type" content="website">
    <meta property="og:url" content="https://www.globalmarketreports.com/v1/">
    <meta property="og:title" content="API v1 Documentation - Global Market Reports">
    <meta property="og:description" content="Access comprehensive market research data via REST API. Authentication, rate limiting, and endpoint documentation.">
    <meta property="og:image" content="https://www.globalmarketreports.com/assets/images/og-image.svg">

    <!-- Twitter -->
    <meta property="twitter:card" content="summary_large_image">
    <meta property="twitter:url" content="https://www.globalmarketreports.com/v1/">
    <meta property="twitter:title" content="API v1 Documentation - Global Market Reports">
    <meta property="twitter:description" content="Access comprehensive market research data via REST API. Authentication, rate limiting, and endpoint documentation.">
    <meta property="twitter:image" content="https://www.globalmarketreports.com/assets/images/og-image.svg">

    <!-- Favicon -->
    <link rel="icon" href="/assets/images/favicon.ico" sizes="any">
    <link rel="icon" href="/assets/images/favicon.svg" type="image/svg+xml">
    <link rel="apple-touch-icon" href="/assets/images/apple-touch-icon.png">

    <!-- Fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@200;300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600;700&display=swap" rel="stylesheet">

    <!-- Tailwind CSS -->
    <script src="https://cdn.tailwindcss.com"></script>

    <!-- App Stylesheet -->
    <link rel="stylesheet" href="/assets/css/app.css">

    <!-- GSAP for Animations -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script>

    <!-- Chart.js for Data Visualization -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.9.1/chart.min.js"></script>

    <!-- Additional Head Content -->
    
    <!-- Analytics Placeholder -->
    <!-- Google Analytics would go here -->
</head>
<body>
<!-- ============================================================================
     TOPBAR - Contact & Info
     ============================================================================ -->
<div class="topbar" id="topbar">
    <div class="container">
        <div class="topbar__content">
            <div class="topbar__left">
                <div class="topbar__item">
                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" width="16" height="16">
                        <rect x="2" y="4" width="20" height="16" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/>
                    </svg>
                    <a href="mailto:info@globalmarketreports.com" class="topbar__link">info@globalmarketreports.com</a>
                </div>
                <div class="topbar__item">
                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" width="16" height="16">
                        <path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"/>
                    </svg>
                    <a href="tel:+1-800-000-0000" class="topbar__link">+1-800-000-0000</a>
                </div>
                <div class="topbar__item">
                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" width="16" height="16">
                        <circle cx="12" cy="12" r="10"/>
                        <path d="M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>
                    </svg>
                    <span class="topbar__link">Serving 190+ Countries</span>
                </div>
            </div>
            <div class="topbar__right">
                <a href="/pages/analysts" class="topbar__link">Become an Analyst</a>
                <a href="/press" class="topbar__link">Press Room</a>
                <a href="/auth/login" class="topbar__link">Client Login</a>
            </div>
        </div>
    </div>
</div>

<!-- ============================================================================
     NAVBAR - Main Navigation with Glassmorphism
     ============================================================================ -->
<nav class="navbar" id="navbar">
    <div class="container">
        <div class="navbar__content">
            <!-- Logo — Lottie spinning globe -->
            <a href="/" class="navbar__logo">
                <div class="gmr-logo"
                     data-variant="white"
                     data-size="42"
                     data-speed="0.38"
                     aria-label="Global Market Reports"></div>
            </a>

            <!-- Desktop Navigation -->
            <div class="navbar__nav">
                <a href="/" class="navbar__link">Home</a>
                <div class="navbar__link-with-menu" id="industriesMenu">
                    Industries
                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" width="16" height="16">
                        <polyline points="6 9 12 15 18 9"/>
                    </svg>
                </div>
                <div class="navbar__link-with-menu" id="reportsMenu">
                    Reports
                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" width="16" height="16">
                        <polyline points="6 9 12 15 18 9"/>
                    </svg>
                </div>
                <a href="/gmr" class="navbar__link" style="font-weight:700;background:linear-gradient(135deg,#0055ff,#00c48c);-webkit-background-clip:text;-webkit-text-fill-color:transparent;">GMR</a>
                <a href="/blog" class="navbar__link">Blog</a>
                <a href="/about" class="navbar__link">About</a>
                <a href="/contact" class="navbar__link">Contact</a>
            </div>

            <!-- CTAs -->
            <div class="navbar__ctas">
                <a href="/sample" class="btn btn-secondary btn-sm">Request Sample</a>
                <a href="/auth/register" class="btn btn-primary btn-sm">Get Started</a>
            </div>

            <!-- Mobile Hamburger -->
            <div class="navbar__hamburger" id="hamburger">
                <span></span>
                <span></span>
                <span></span>
            </div>
        </div>
    </div>

    <!-- MEGAMENU: Industries -->
    <div class="megamenu" id="industriesMegamenu">
        <div class="container">
            <div class="megamenu__content">
                <div>
                    <h6 class="megamenu__section-title">Technology & Innovation</h6>
                    <a href="/industries/technology-ai" class="megamenu__item">
                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" class="megamenu__item-icon">
                            <circle cx="12" cy="12" r="2"/>
                            <line x1="12" y1="12" x2="12" y2="3"/><line x1="12" y1="12" x2="12" y2="21"/><line x1="12" y1="12" x2="3" y2="12"/><line x1="12" y1="12" x2="21" y2="12"/>
                        </svg>
                        <div class="megamenu__item-content">
                            <span class="megamenu__item-name">Technology & AI</span>
                            <span class="megamenu__item-desc">Software, cloud, AI/ML insights</span>
                        </div>
                    </a>
                    <a href="/industries/healthcare-pharma" class="megamenu__item">
                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" class="megamenu__item-icon">
                            <path d="M12 4 Q12 12 12 20"/>
                        </svg>
                        <div class="megamenu__item-content">
                            <span class="megamenu__item-name">Healthcare & Pharma</span>
                            <span class="megamenu__item-desc">Medical devices, biotech</span>
                        </div>
                    </a>
                </div>
                <div>
                    <h6 class="megamenu__section-title">Energy & Materials</h6>
                    <a href="/industries/energy-power" class="megamenu__item">
                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" class="megamenu__item-icon">
                            <circle cx="12" cy="12" r="9"/><path d="M12 6 L15 11 L10 11 L13 19"/>
                        </svg>
                        <div class="megamenu__item-content">
                            <span class="megamenu__item-name">Energy & Power</span>
                            <span class="megamenu__item-desc">Oil, gas, renewables</span>
                        </div>
                    </a>
                    <a href="/industries/chemicals-materials" class="megamenu__item">
                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" class="megamenu__item-icon">
                            <path d="M12 4 L17.2 7 L17.2 13 L12 16 L6.8 13 L6.8 7 Z"/>
                        </svg>
                        <div class="megamenu__item-content">
                            <span class="megamenu__item-name">Chemicals & Materials</span>
                            <span class="megamenu__item-desc">Polymers, specialty chemicals</span>
                        </div>
                    </a>
                </div>
                <div>
                    <h6 class="megamenu__section-title">Manufacturing & Transportation</h6>
                    <a href="/industries/automotive-transport" class="megamenu__item">
                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" class="megamenu__item-icon">
                            <circle cx="12" cy="12" r="7"/><circle cx="12" cy="12" r="4"/>
                        </svg>
                        <div class="megamenu__item-content">
                            <span class="megamenu__item-name">Automotive & Transport</span>
                            <span class="megamenu__item-desc">Electric vehicles, logistics</span>
                        </div>
                    </a>
                    <a href="/industries/logistics-supply-chain" class="megamenu__item">
                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" class="megamenu__item-icon">
                            <rect x="4" y="6" width="12" height="10" rx="1"/><path d="M18 8 L22 8"/>
                        </svg>
                        <div class="megamenu__item-content">
                            <span class="megamenu__item-name">Logistics & Supply Chain</span>
                            <span class="megamenu__item-desc">Distribution, cold chain</span>
                        </div>
                    </a>
                </div>
                <div>
                    <h6 class="megamenu__section-title">Consumer & Finance</h6>
                    <a href="/industries/consumer-goods" class="megamenu__item">
                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" class="megamenu__item-icon">
                            <path d="M6 3 L8 3 L8 5 L16 5 L16 3 L18 3 L20 8"/>
                        </svg>
                        <div class="megamenu__item-content">
                            <span class="megamenu__item-name">Consumer Goods</span>
                            <span class="megamenu__item-desc">Retail, CPG, e-commerce</span>
                        </div>
                    </a>
                    <a href="/industries/bfsi" class="megamenu__item">
                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" class="megamenu__item-icon">
                            <path d="M4 6 L12 2 L20 6 L20 12"/>
                        </svg>
                        <div class="megamenu__item-content">
                            <span class="megamenu__item-name">BFSI</span>
                            <span class="megamenu__item-desc">Banking, fintech, insurance</span>
                        </div>
                    </a>
                </div>
            </div>
        </div>
    </div>

    <!-- MEGAMENU: Reports -->
    <div class="megamenu" id="reportsMegamenu">
        <div class="container">
            <div class="megamenu__content" style="grid-template-columns: repeat(3, 1fr);">
                <div>
                    <h6 class="megamenu__section-title">Popular Reports</h6>
                    <a href="/reports?slug=ai-market-2024" class="megamenu__item">
                        <div class="megamenu__item-content">
                            <span class="megamenu__item-name">AI Market 2024</span>
                            <span class="megamenu__item-desc">150+ pages, trending</span>
                        </div>
                    </a>
                    <a href="/reports?slug=ev-market-2024" class="megamenu__item">
                        <div class="megamenu__item-content">
                            <span class="megamenu__item-name">EV Market Report</span>
                            <span class="megamenu__item-desc">Comprehensive analysis</span>
                        </div>
                    </a>
                </div>
                <div>
                    <h6 class="megamenu__section-title">Browse by Type</h6>
                    <a href="/reports?type=market-size" class="megamenu__item">
                        <div class="megamenu__item-content">
                            <span class="megamenu__item-name">Market Size Reports</span>
                        </div>
                    </a>
                    <a href="/reports?type=trend" class="megamenu__item">
                        <div class="megamenu__item-content">
                            <span class="megamenu__item-name">Trend Analysis</span>
                        </div>
                    </a>
                </div>
                <div>
                    <h6 class="megamenu__section-title">Quick Actions</h6>
                    <a href="/compare" class="megamenu__item">
                        <div class="megamenu__item-content">
                            <span class="megamenu__item-name">Compare Reports</span>
                        </div>
                    </a>
                    <a href="/sample" class="megamenu__item">
                        <div class="megamenu__item-content">
                            <span class="megamenu__item-name">Request Sample</span>
                        </div>
                    </a>
                </div>
            </div>
        </div>
    </div>
</nav>

<!-- ============================================================================
     MOBILE NAVIGATION (Hidden by default, shown on hamburger click)
     ============================================================================ -->
<div class="mobile-menu" id="mobileMenu" style="display: none; position: fixed; top: 80px; left: 0; right: 0; bottom: 0; background: white; z-index: 999; overflow-y: auto;">
    <div class="p-6">
        <a href="/" class="block py-4 px-4 font-bold text-ink hover:text-accent transition">Home</a>
        <a href="/industries" class="block py-4 px-4 font-bold text-ink hover:text-accent transition">Industries</a>
        <a href="/reports" class="block py-4 px-4 font-bold text-ink hover:text-accent transition">Reports</a>
        <a href="/gmr" class="block py-4 px-4 font-bold text-accent transition">🌍 GMR Explorer</a>
        <a href="/blog" class="block py-4 px-4 font-bold text-ink hover:text-accent transition">Blog</a>
        <a href="/about" class="block py-4 px-4 font-bold text-ink hover:text-accent transition">About</a>
        <a href="/contact" class="block py-4 px-4 font-bold text-ink hover:text-accent transition">Contact</a>
        <div class="mt-6 flex flex-col gap-3 pt-6 border-t border-border">
            <a href="/sample" class="btn btn-secondary w-full">Request Sample</a>
            <a href="/auth/register" class="btn btn-primary w-full">Get Started</a>
        </div>
    </div>
</div>

<script>
// Topbar smart hide on scroll + navbar repositioning
const topbar = document.getElementById('topbar');
const navbar = document.getElementById('navbar');

function updateNavbarPosition() {
    const currentScroll = window.pageYOffset || document.documentElement.scrollTop;
    if (currentScroll > 80) {
        topbar.classList.add('hidden');
        navbar.style.top = '0';
    } else {
        topbar.classList.remove('hidden');
        navbar.style.top = '33px';
    }
    if (currentScroll > 10) {
        navbar.classList.add('scrolled');
    } else {
        navbar.classList.remove('scrolled');
    }
}

window.addEventListener('scroll', updateNavbarPosition);
// Set initial position on load
updateNavbarPosition();

// Megamenu interactions
const industriesMenu = document.getElementById('industriesMenu');
const reportsMenu = document.getElementById('reportsMenu');
const industriesMegamenu = document.getElementById('industriesMegamenu');
const reportsMegamenu = document.getElementById('reportsMegamenu');

industriesMenu.addEventListener('click', function(e) {
    e.stopPropagation();
    industriesMegamenu.classList.toggle('active');
    reportsMegamenu.classList.remove('active');
});

reportsMenu.addEventListener('click', function(e) {
    e.stopPropagation();
    reportsMegamenu.classList.toggle('active');
    industriesMegamenu.classList.remove('active');
});

document.addEventListener('click', function() {
    industriesMegamenu.classList.remove('active');
    reportsMegamenu.classList.remove('active');
});

// Mobile menu toggle
const hamburger = document.getElementById('hamburger');
const mobileMenu = document.getElementById('mobileMenu');

hamburger.addEventListener('click', function(e) {
    e.stopPropagation();
    hamburger.classList.toggle('open');
    mobileMenu.style.display = mobileMenu.style.display === 'none' ? 'block' : 'none';
});

document.addEventListener('click', function() {
    hamburger.classList.remove('open');
    mobileMenu.style.display = 'none';
});
</script>

<!-- API Documentation Page -->
<main class="api-docs">
    <div class="container py-5">
        <div class="row">
            <div class="col-lg-3">
                <!-- Sidebar Navigation -->
                <div class="api-sidebar">
                    <nav class="nav flex-column">
                        <a class="nav-link active" href="#introduction">Introduction</a>
                        <a class="nav-link" href="#authentication">Authentication</a>
                        <a class="nav-link" href="#rate-limiting">Rate Limiting</a>
                        <a class="nav-link" href="#endpoints">Endpoints</a>
                        <a class="nav-link" href="#errors">Error Handling</a>
                        <a class="nav-link" href="#examples">Code Examples</a>
                        <a class="nav-link" href="#generate-key">API Keys</a>
                    </nav>
                </div>
            </div>

            <div class="col-lg-9">
                <!-- Introduction -->
                <section id="introduction" class="api-section mb-5">
                    <h1>Global Market Reports API v1</h1>
                    <p class="lead">Access comprehensive market research reports and industry data programmatically.</p>

                    <p>The GMR API provides RESTful endpoints to search, retrieve, and analyze market intelligence data. All endpoints require authentication and are rate-limited to ensure fair access for all users.</p>

                    <div class="alert alert-info">
                        <strong>Base URL:</strong> <code>https://www.globalmarketreports.com/v1</code>
                    </div>

                    <h4>Features</h4>
                    <ul>
                        <li>Search reports by keyword, industry, and date range</li>
                        <li>Retrieve detailed report metadata and pricing</li>
                        <li>Access industry classifications and market segments</li>
                        <li>Paginated results with flexible filtering and sorting</li>
                        <li>CORS-enabled for cross-origin requests</li>
                        <li>JSON responses with consistent error handling</li>
                    </ul>
                </section>

                <!-- Authentication -->
                <section id="authentication" class="api-section mb-5">
                    <h2>Authentication</h2>

                    <p>All API requests require authentication using an API key. Include your API key in the <code>Authorization</code> header with the Bearer scheme:</p>

                    <div class="code-block">
<pre><code>Authorization: Bearer gmr_live_your_api_key_here</code></pre>
                    </div>

                    <h4>API Key Format</h4>
                    <ul>
                        <li><strong>Production:</strong> Prefix <code>gmr_live_</code> followed by a 32-character key</li>
                        <li><strong>Test:</strong> Prefix <code>gmr_test_</code> (available upon request)</li>
                    </ul>

                    <h4>How to Get an API Key</h4>
                    <ol>
                        <li>Log in to your <a href="/dashboard" target="_blank">Global Market Reports account</a></li>
                        <li>Navigate to <a href="/dashboard/settings" target="_blank">Settings → API Keys</a></li>
                        <li>Click "Generate API Key" and give it a name</li>
                        <li>Copy the key immediately (it won't be shown again)</li>
                        <li>Use it in the <code>Authorization</code> header for all requests</li>
                    </ol>

                    <a href="/dashboard/settings" class="btn btn-primary mb-3">Generate API Key</a>

                    <h4>Invalid or Missing Authorization</h4>
                    <div class="alert alert-danger">
                        Returns <code>401 Unauthorized</code>. Check that:
                        <ul class="mb-0">
                            <li>Your API key is included in the Authorization header</li>
                            <li>The key format is correct: <code>Authorization: Bearer gmr_live_...</code></li>
                            <li>The key hasn't expired (check your dashboard)</li>
                            <li>Your account is active</li>
                        </ul>
                    </div>
                </section>

                <!-- Rate Limiting -->
                <section id="rate-limiting" class="api-section mb-5">
                    <h2>Rate Limiting</h2>

                    <p>The API enforces rate limiting to ensure fair access. Your quota is reset every hour (UTC).</p>

                    <div class="alert alert-warning">
                        <strong>Rate Limit:</strong> 1000 requests per hour
                    </div>

                    <h4>Checking Your Rate Limit Status</h4>
                    <p>All API responses include rate limit headers:</p>

                    <div class="code-block">
<pre><code>X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 845
X-RateLimit-Reset: 1649508000</code></pre>
                    </div>

                    <h4>Rate Limit Exceeded</h4>
                    <p>When you exceed the rate limit, the API returns <code>429 Too Many Requests</code>. The <code>Retry-After</code> header indicates how many seconds to wait before retrying.</p>

                    <div class="code-block">
<pre><code>HTTP/1.1 429 Too Many Requests
Retry-After: 3600
Content-Type: application/json

{
    "error": {
        "code": 429,
        "message": "Rate limit exceeded. Please try again in 3600 seconds."
    }
}</code></pre>
                    </div>

                    <h4>Tips to Avoid Rate Limits</h4>
                    <ul>
                        <li>Cache frequently accessed data locally</li>
                        <li>Use pagination to fetch results in batches</li>
                        <li>Implement exponential backoff for retries</li>
                        <li>Monitor the <code>X-RateLimit-Remaining</code> header</li>
                    </ul>
                </section>

                <!-- Endpoints -->
                <section id="endpoints" class="api-section mb-5">
                    <h2>Endpoints</h2>

                    <!-- GET /v1/reports -->
                    <div class="endpoint mb-4">
                        <h4><span class="badge bg-primary">GET</span> /v1/reports</h4>
                        <p>List all published market reports with filtering, pagination, and sorting.</p>

                        <h5>Query Parameters</h5>
                        <table class="table table-sm table-bordered">
                            <thead>
                                <tr>
                                    <th>Parameter</th>
                                    <th>Type</th>
                                    <th>Default</th>
                                    <th>Description</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td><code>page</code></td>
                                    <td>integer</td>
                                    <td>1</td>
                                    <td>Page number for pagination</td>
                                </tr>
                                <tr>
                                    <td><code>per_page</code></td>
                                    <td>integer</td>
                                    <td>20</td>
                                    <td>Results per page (max 100)</td>
                                </tr>
                                <tr>
                                    <td><code>industry</code></td>
                                    <td>string</td>
                                    <td>-</td>
                                    <td>Filter by industry slug</td>
                                </tr>
                                <tr>
                                    <td><code>search</code></td>
                                    <td>string</td>
                                    <td>-</td>
                                    <td>Search in title and description</td>
                                </tr>
                                <tr>
                                    <td><code>sort</code></td>
                                    <td>string</td>
                                    <td>newest</td>
                                    <td>Sort by: newest, oldest, price_asc, price_desc, popular</td>
                                </tr>
                            </tbody>
                        </table>

                        <h5>Response Example</h5>
                        <div class="code-block">
<pre><code>{
    "success": true,
    "data": [
        {
            "id": 1,
            "title": "Global Artificial Intelligence Market",
            "slug": "global-ai-market-2024",
            "subtitle": "2024-2030 Analysis and Forecast",
            "description": "Comprehensive analysis of the global AI market...",
            "industry_id": 5,
            "industry_name": "Technology",
            "author_id": 12,
            "author_name": "Jane Smith",
            "page_count": 245,
            "published_at": "2024-03-15T10:30:00Z",
            "image": "/assets/reports/ai-market.jpg",
            "rating": 4.8,
            "rating_count": 142,
            "downloads": 856,
            "pricing": {
                "single": 4900,
                "team": 12900,
                "enterprise": 49900
            }
        }
    ],
    "meta": {
        "total": 427,
        "page": 1,
        "per_page": 20,
        "total_pages": 22
    },
    "links": {
        "first": "/v1/reports?page=1",
        "last": "/v1/reports?page=22",
        "next": "/v1/reports?page=2"
    }
}</code></pre>
                        </div>
                    </div>

                    <!-- GET /v1/reports/{slug} -->
                    <div class="endpoint mb-4">
                        <h4><span class="badge bg-primary">GET</span> /v1/reports/{slug}</h4>
                        <p>Retrieve detailed information about a specific report.</p>

                        <h5>URL Parameters</h5>
                        <table class="table table-sm table-bordered">
                            <thead>
                                <tr>
                                    <th>Parameter</th>
                                    <th>Description</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td><code>slug</code></td>
                                    <td>Report slug identifier (URL-safe string)</td>
                                </tr>
                            </tbody>
                        </table>

                        <h5>Response Example</h5>
                        <div class="code-block">
<pre><code>{
    "success": true,
    "data": {
        "id": 1,
        "title": "Global Artificial Intelligence Market",
        "slug": "global-ai-market-2024",
        "subtitle": "2024-2030 Analysis and Forecast",
        "description": "...",
        "page_count": 245,
        "market_size": "$183.7 billion",
        "cagr": "38.5%",
        "forecast_period": "2024-2030",
        "published_at": "2024-03-15T10:30:00Z",
        "industry": {
            "id": 5,
            "name": "Technology",
            "slug": "technology"
        },
        "analyst": {
            "id": 12,
            "name": "Jane Smith",
            "email": "jane@globalmarketreports.com"
        },
        "segments": [
            "Machine Learning",
            "Natural Language Processing",
            "Computer Vision"
        ],
        "regions": [
            "North America",
            "Europe",
            "Asia Pacific"
        ],
        "companies": [
            "OpenAI",
            "Google",
            "Microsoft"
        ],
        "pricing": {
            "single": {"amount": 4900, "currency": "USD"},
            "team": {"amount": 12900, "currency": "USD"},
            "enterprise": {"amount": 49900, "currency": "USD"}
        },
        "faq": [
            {
                "question": "What is included in this report?",
                "answer": "The report includes market overview, competitive landscape, and forecast analysis..."
            }
        ]
    }
}</code></pre>
                        </div>
                    </div>

                    <!-- GET /v1/industries -->
                    <div class="endpoint mb-4">
                        <h4><span class="badge bg-primary">GET</span> /v1/industries</h4>
                        <p>List all active industry categories with report counts.</p>

                        <h5>Query Parameters</h5>
                        <table class="table table-sm table-bordered">
                            <thead>
                                <tr>
                                    <th>Parameter</th>
                                    <th>Type</th>
                                    <th>Description</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td><code>limit</code></td>
                                    <td>integer</td>
                                    <td>Maximum industries to return (default 50)</td>
                                </tr>
                            </tbody>
                        </table>

                        <h5>Response Example</h5>
                        <div class="code-block">
<pre><code>{
    "success": true,
    "data": [
        {
            "id": 1,
            "name": "Healthcare",
            "slug": "healthcare",
            "description": "Medical devices, pharmaceuticals, and healthcare services",
            "report_count": 45,
            "icon_name": "fa-heartbeat"
        },
        {
            "id": 2,
            "name": "Technology",
            "slug": "technology",
            "description": "Software, hardware, and digital innovation",
            "report_count": 78,
            "icon_name": "fa-laptop"
        }
    ],
    "meta": {
        "total": 32
    }
}</code></pre>
                        </div>
                    </div>

                    <!-- GET /v1/search -->
                    <div class="endpoint mb-4">
                        <h4><span class="badge bg-primary">GET</span> /v1/search</h4>
                        <p>Full-text search across all reports with relevance ranking.</p>

                        <h5>Query Parameters</h5>
                        <table class="table table-sm table-bordered">
                            <thead>
                                <tr>
                                    <th>Parameter</th>
                                    <th>Type</th>
                                    <th>Required</th>
                                    <th>Description</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td><code>q</code></td>
                                    <td>string</td>
                                    <td>Yes</td>
                                    <td>Search query (minimum 2 characters)</td>
                                </tr>
                                <tr>
                                    <td><code>page</code></td>
                                    <td>integer</td>
                                    <td>No</td>
                                    <td>Page number (default 1)</td>
                                </tr>
                                <tr>
                                    <td><code>per_page</code></td>
                                    <td>integer</td>
                                    <td>No</td>
                                    <td>Results per page (default 20, max 100)</td>
                                </tr>
                            </tbody>
                        </table>

                        <h5>Response Example</h5>
                        <div class="code-block">
<pre><code>{
    "success": true,
    "query": "artificial intelligence",
    "data": [
        {
            "id": 1,
            "title": "Global Artificial Intelligence Market",
            "slug": "global-ai-market-2024",
            "relevance_score": 0.95,
            "snippet": "The global AI market is experiencing rapid growth with a CAGR of 38.5% from 2024 to 2030..."
        }
    ],
    "meta": {
        "total": 12,
        "page": 1,
        "per_page": 20,
        "total_pages": 1
    }
}</code></pre>
                        </div>
                    </div>
                </section>

                <!-- Error Handling -->
                <section id="errors" class="api-section mb-5">
                    <h2>Error Handling</h2>

                    <p>The API uses standard HTTP status codes. All errors are returned as JSON with a structured error object.</p>

                    <h4>Error Response Format</h4>
                    <div class="code-block">
<pre><code>{
    "success": false,
    "error": {
        "code": 400,
        "message": "Invalid parameter",
        "details": "The 'page' parameter must be a positive integer"
    }
}</code></pre>
                    </div>

                    <h4>Status Codes</h4>
                    <table class="table table-sm table-bordered">
                        <thead>
                            <tr>
                                <th>Code</th>
                                <th>Message</th>
                                <th>Description</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td><code>200</code></td>
                                <td>OK</td>
                                <td>Request succeeded</td>
                            </tr>
                            <tr>
                                <td><code>400</code></td>
                                <td>Bad Request</td>
                                <td>Invalid parameters or malformed request</td>
                            </tr>
                            <tr>
                                <td><code>401</code></td>
                                <td>Unauthorized</td>
                                <td>Missing or invalid API key</td>
                            </tr>
                            <tr>
                                <td><code>403</code></td>
                                <td>Forbidden</td>
                                <td>API key lacks permissions for the resource</td>
                            </tr>
                            <tr>
                                <td><code>404</code></td>
                                <td>Not Found</td>
                                <td>Requested resource doesn't exist</td>
                            </tr>
                            <tr>
                                <td><code>429</code></td>
                                <td>Too Many Requests</td>
                                <td>Rate limit exceeded</td>
                            </tr>
                            <tr>
                                <td><code>500</code></td>
                                <td>Internal Server Error</td>
                                <td>Server error (retry after a delay)</td>
                            </tr>
                        </tbody>
                    </table>
                </section>

                <!-- Code Examples -->
                <section id="examples" class="api-section mb-5">
                    <h2>Code Examples</h2>

                    <h4>cURL</h4>
                    <div class="code-block">
<pre><code class="language-bash"># List reports
curl -X GET "https://www.globalmarketreports.com/v1/reports?page=1&per_page=10" \
  -H "Authorization: Bearer gmr_live_your_key_here"

# Get single report
curl -X GET "https://www.globalmarketreports.com/v1/reports/global-ai-market-2024" \
  -H "Authorization: Bearer gmr_live_your_key_here"

# Search reports
curl -X GET "https://www.globalmarketreports.com/v1/search?q=artificial+intelligence&per_page=5" \
  -H "Authorization: Bearer gmr_live_your_key_here"

# List industries
curl -X GET "https://www.globalmarketreports.com/v1/industries" \
  -H "Authorization: Bearer gmr_live_your_key_here"</code></pre>
                    </div>

                    <h4>PHP</h4>
                    <div class="code-block">
<pre><code class="language-php"> total reports
An error occurred. Please try again later.