```javascript Slack (JS) theme={null}
async function sendToSlack(report, webhookUrl) {
const formatMetric = (m) => {
const icon = m.trend === 'up' ? ':chart_with_upwards_trend:' : m.trend === 'down' ? ':chart_with_downwards_trend:' : ':arrow_right:';
const sign = m.change > 0 ? '+' : '';
return `${icon} *${m.name}*: ${m.current} (${sign}${m.change}%)`;
};
const blocks = [
{
type: 'header',
text: { type: 'plain_text', text: `Weekly GEO Report` },
},
{
type: 'section',
text: {
type: 'mrkdwn',
text: `*Period:* ${report.period.thisWeek.start} to ${report.period.thisWeek.end}`,
},
},
{
type: 'section',
text: {
type: 'mrkdwn',
text: report.metrics.map(formatMetric).join('\n'),
},
},
];
await fetch(webhookUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ blocks }),
});
}
// Usage
await sendToSlack(report, process.env.SLACK_WEBHOOK_URL);
```
```javascript Email (JS) theme={null}
const { Resend } = require('resend');
async function sendByEmail(report, to) {
const resend = new Resend(process.env.RESEND_API_KEY);
const formatRow = (m) => {
const arrow = m.trend === 'up' ? '↑' : m.trend === 'down' ? '↓' : '→';
const sign = m.change > 0 ? '+' : '';
return `| ${m.name} | ${m.current} | ${m.previous} | ${arrow} ${sign}${m.change}% |
`;
};
const html = `
Weekly GEO Report
Period: ${report.period.thisWeek.start} to ${report.period.thisWeek.end}
| Metric | Current | Previous | Change |
${report.metrics.map(formatRow).join('')}
`;
await resend.emails.send({
from: 'reports@yourdomain.com',
to,
subject: `Weekly GEO Report - ${report.period.thisWeek.end}`,
html,
});
}
// Usage
await sendByEmail(report, ['team@company.com']);
```
```python Slack (Python) theme={null}
import requests
def send_to_slack(report: dict, webhook_url: str):
"""Send report to Slack channel."""
def format_metric(m):
icon = ':chart_with_upwards_trend:' if m['trend'] == 'up' else ':chart_with_downwards_trend:' if m['trend'] == 'down' else ':arrow_right:'
sign = '+' if m['change'] and float(m['change']) > 0 else ''
return f"{icon} *{m['name']}*: {m['current']} ({sign}{m['change']}%)"
blocks = [
{'type': 'header', 'text': {'type': 'plain_text', 'text': 'Weekly GEO Report'}},
{'type': 'section', 'text': {'type': 'mrkdwn', 'text': f"*Period:* {report['period']['this_week']['start']} to {report['period']['this_week']['end']}"}},
{'type': 'section', 'text': {'type': 'mrkdwn', 'text': '\n'.join(format_metric(m) for m in report['metrics'])}},
]
requests.post(webhook_url, json={'blocks': blocks})
# Usage
send_to_slack(report, os.environ['SLACK_WEBHOOK_URL'])
```
```python Email (Python) theme={null}
import resend
def send_by_email(report: dict, to: list):
"""Send report via email using Resend."""
resend.api_key = os.environ['RESEND_API_KEY']
def format_row(m):
arrow = '↑' if m['trend'] == 'up' else '↓' if m['trend'] == 'down' else '→'
sign = '+' if m['change'] and float(m['change']) > 0 else ''
return f"| {m['name']} | {m['current']} | {m['previous']} | {arrow} {sign}{m['change']}% |
"
html = f"""
Weekly GEO Report
Period: {report['period']['this_week']['start']} to {report['period']['this_week']['end']}
| Metric | Current | Previous | Change |
{''.join(format_row(m) for m in report['metrics'])}
"""
resend.Emails.send({
'from': 'reports@yourdomain.com',
'to': to,
'subject': f"Weekly GEO Report - {report['period']['this_week']['end']}",
'html': html,
})
# Usage
send_by_email(report, ['team@company.com'])
```
***
## Scheduling
Run this report automatically:
| Platform | Method |
| ------------------ | ------------------------------------- |
| **Cron** | `0 9 * * MON` (every Monday at 9am) |
| **GitHub Actions** | `schedule: cron: '0 9 * * 1'` |
| **AWS Lambda** | EventBridge rule with cron expression |
| **Google Cloud** | Cloud Scheduler + Cloud Functions |
***
## Next Steps
* Build a [custom dashboard](/developers/guides/custom-dashboard) for real-time monitoring
* Add [competitive analysis](/developers/guides/competitive-analysis) to your reports
* [Export data](/developers/guides/data-export) to your BI tools
# Introduction
Source: https://docs.qwairy.co/developers/introduction
Get started with the Qwairy API v1 and integrate GEO data into your workflows
Build custom dashboards, integrate with your marketing stack, or create automated reports using your GEO (Generative Engine Optimization) data.