> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trendteller.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Data Exports

> Exporting and integrating your Trendteller data

## Overview

Trendteller provides multiple ways to export your e-commerce data for analysis in external tools, integration with other systems, or archival purposes.

## Export Methods

<CardGroup cols={2}>
  <Card title="CSV Export" icon="file-csv">
    Export raw data to CSV for Excel, Google Sheets, or other tools
  </Card>

  <Card title="PDF Reports" icon="file-pdf">
    Generate formatted PDF reports with charts and visualizations
  </Card>

  <Card title="API Access" icon="code">
    Programmatic access via GraphQL API for custom integrations
  </Card>

  <Card title="Scheduled Reports" icon="clock">
    Automated email delivery on a schedule
  </Card>
</CardGroup>

## CSV Exports

### Exporting from Dashboard

<Steps>
  <Step title="Apply Filters">
    Select the data you want to export:

    * Date range
    * Brand(s)
    * Product categories
    * Other filters
  </Step>

  <Step title="Choose Export">
    Click the "Export" button and select "CSV Export"
  </Step>

  <Step title="Select Fields">
    Choose which columns to include in your export:

    * All fields
    * Custom field selection
    * Predefined templates
  </Step>

  <Step title="Download">
    File is generated and downloaded automatically:

    * Format: UTF-8 encoded CSV
    * Filename: `trendteller_export_YYYY-MM-DD.csv`
  </Step>
</Steps>

### Available Data Sets

<Tabs>
  <Tab title="Orders">
    **Fields:**

    * Order ID, Date, Time
    * Brand, Customer ID
    * Total amount, Discount, Tax
    * Shipping method, Status
    * Payment method
    * Items (expandable)
  </Tab>

  <Tab title="Products">
    **Fields:**

    * Product ID, SKU
    * Name, Description
    * Category, Brand
    * Price, Cost, Margin
    * Stock quantity, Location
    * Sales metrics
  </Tab>

  <Tab title="Customers">
    **Fields:**

    * Customer ID, Name
    * Email, Phone
    * Address, City, State
    * Registration date
    * Total orders, Total spent
    * Lifetime value
  </Tab>

  <Tab title="Analytics">
    **Aggregated metrics:**

    * Daily/weekly/monthly summaries
    * Brand performance
    * Category analytics
    * Custom date ranges
  </Tab>
</Tabs>

<Tip>
  Large exports (>100K rows) are processed in the background and emailed when ready.
</Tip>

## PDF Reports

### Report Types

<AccordionGroup>
  <Accordion title="Executive Summary">
    High-level overview with key metrics:

    * Revenue and growth
    * Top products and categories
    * Customer insights
    * AI forecasts and recommendations

    **Pages**: 2-3 pages
    **Best for**: Weekly/monthly leadership updates
  </Accordion>

  <Accordion title="Detailed Analytics">
    Comprehensive analysis with charts:

    * All major metrics with trends
    * Product performance tables
    * Customer segmentation
    * Comparative analysis

    **Pages**: 10-15 pages
    **Best for**: Deep dives and strategy sessions
  </Accordion>

  <Accordion title="Brand Comparison">
    Multi-brand comparative report:

    * Side-by-side brand metrics
    * Performance rankings
    * Market share analysis
    * Portfolio insights

    **Pages**: 5-8 pages
    **Best for**: Portfolio management
  </Accordion>

  <Accordion title="Custom Reports">
    Build your own report:

    * Choose metrics and charts
    * Add custom text sections
    * Include/exclude brands
    * Save as template

    **Pages**: Variable
    **Best for**: Specific business needs
  </Accordion>
</AccordionGroup>

### Generating PDF Reports

```bash theme={null}
1. Navigate to Reports section
2. Select report type
3. Configure parameters (dates, brands, etc.)
4. Click "Generate PDF"
5. Download when processing completes (~30 seconds)
```

## API Access

### GraphQL API

Access all your data programmatically via GraphQL:

```graphql theme={null}
query ExportOrders {
  orders(
    where: {
      created_at: { _gte: "2024-01-01" }
      brand_id: { _eq: "brand-123" }
    }
    order_by: { created_at: desc }
    limit: 1000
  ) {
    id
    total
    status
    customer {
      name
      email
    }
    items {
      product {
        name
        sku
      }
      quantity
      price
    }
  }
}
```

<Info>
  See the [API Reference](/api-reference/introduction) for complete documentation on available queries and authentication.
</Info>

### Pagination

For large datasets, use pagination:

```graphql theme={null}
query ExportOrdersPaginated {
  orders(
    limit: 100
    offset: 0
    order_by: { created_at: desc }
  ) {
    id
    total
    created_at
  }
}
```

### Rate Limits

API rate limits depend on your plan:

| Plan       | Requests/Hour | Concurrent |
| ---------- | ------------- | ---------- |
| Free       | 100           | 2          |
| Pro        | 1,000         | 10         |
| Enterprise | Custom        | Custom     |

## Scheduled Reports

### Setting Up Automated Reports

<Steps>
  <Step title="Create Report">
    Design your report with desired filters and layout
  </Step>

  <Step title="Set Schedule">
    Choose frequency:

    * Daily (specific time)
    * Weekly (day and time)
    * Monthly (date and time)
    * Custom (cron expression)
  </Step>

  <Step title="Configure Recipients">
    Add email addresses:

    * Multiple recipients supported
    * CC and BCC options
    * Custom subject and message
  </Step>

  <Step title="Activate">
    Enable the scheduled report. You'll receive the first report at the next scheduled time.
  </Step>
</Steps>

### Report Formats

Scheduled reports can be sent as:

<CardGroup cols={2}>
  <Card title="Email with PDF" icon="envelope">
    PDF report attached to email with summary in body
  </Card>

  <Card title="CSV Attachment" icon="paperclip">
    Raw data as CSV attachment for analysis
  </Card>

  <Card title="Dashboard Link" icon="link">
    Email with link to interactive dashboard view
  </Card>

  <Card title="Slack/Teams" icon="message">
    Post to Slack or Microsoft Teams channels
  </Card>
</CardGroup>

## Data Integration

### Webhooks

Receive real-time data updates via webhooks:

```json theme={null}
{
  "event": "order.created",
  "timestamp": "2024-01-15T10:30:00Z",
  "data": {
    "order_id": "ord_123",
    "brand_id": "brand_456",
    "total": 150.00,
    "items": [...]
  }
}
```

**Available Events:**

* `order.created`, `order.updated`, `order.cancelled`
* `product.created`, `product.updated`, `product.deleted`
* `inventory.updated`, `inventory.low_stock`
* `forecast.generated`, `insight.created`

### Third-Party Integrations

Export data directly to other platforms:

<Tabs>
  <Tab title="Google Sheets">
    Automatic sync to Google Sheets:

    * Real-time or scheduled updates
    * Choose specific data tables
    * Maintains formatting
  </Tab>

  <Tab title="Data Warehouses">
    Export to your data warehouse:

    * Snowflake
    * Redshift
    * BigQuery (native)
    * Azure Synapse
  </Tab>

  <Tab title="BI Tools">
    Connect directly to BI platforms:

    * Tableau
    * Power BI
    * Looker
    * Metabase
  </Tab>
</Tabs>

## Data Retention

<Info>
  **Export Data Retention:**

  * CSV exports: Stored for 7 days
  * PDF reports: Stored for 90 days
  * API access: Real-time, no storage
  * Scheduled reports: Last 30 reports stored
</Info>

## Best Practices

<AccordionGroup>
  <Accordion title="Regular Exports">
    Export data regularly for backup:

    * Weekly full data export
    * Daily incremental exports
    * Store in secure location
  </Accordion>

  <Accordion title="Filter Before Export">
    Apply filters to reduce file size:

    * Export only necessary date ranges
    * Select specific brands or categories
    * Choose relevant fields only
  </Accordion>

  <Accordion title="Automate Where Possible">
    Use scheduled reports instead of manual exports:

    * Consistent timing
    * No manual effort
    * Reliable delivery
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="API Reference" icon="code" href="/api-reference/introduction">
    Learn about API-based data access
  </Card>

  <Card title="GraphQL Queries" icon="diagram-project" href="/api-reference/graphql/queries">
    Write custom GraphQL queries
  </Card>

  <Card title="Webhooks" icon="webhook" href="/api-reference/integrations/webhooks">
    Set up real-time data webhooks
  </Card>

  <Card title="Integration Guide" icon="plug" href="/api-reference/integrations/best-practices">
    Best practices for integrations
  </Card>
</CardGroup>
