Facebook insights
pinmeto_get_facebook_insightsFetch Facebook metrics for all locations or a single store, with optional time aggregation and period-over-period comparisons to track performance.
Instructions
Fetch Facebook metrics for all locations, or a single location if storeId provided. Supports time aggregation (default: total) and period comparisons.
Comparison Options:
compare_with="prior_period": Compare with same-duration period before (MoM, QoQ)
compare_with="prior_year": Compare with same dates last year (YoY)
When comparison is active, each metric includes a comparison field with prior, delta, deltaPercent
Error Handling:
Rate limit (429): errorCode="RATE_LIMITED", message includes retry timing
Not found (404): errorCode="NOT_FOUND" if storeId doesn't exist
All errors: check structuredContent.errorCode and .retryable for programmatic handling
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | End date (YYYY-MM-DD) | |
| from | Yes | Start date (YYYY-MM-DD) | |
| storeId | No | Optional store ID to fetch a single location | |
| aggregation | No | Time aggregation: total (default, maximum token reduction), daily, weekly, monthly, quarterly, half-yearly, yearly | total |
| compare_with | No | Compare with: prior_period (MoM/QoQ for same-duration period before), prior_year (YoY for same dates last year), or none (default) | none |
| response_format | No | Response format: "json" (default, token-efficient) or "markdown" (human-readable with tables) | json |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Error message if the request failed | |
| warning | No | Warning message (e.g., incomplete data due to lag) | |
| insights | No | Array of insights by metric. Flattened (no values array) when aggregation=total, multi-period otherwise (absent on error) | |
| errorCode | No | Error code for programmatic handling | |
| retryable | No | Whether the operation can be retried | |
| compareWith | No | Comparison period type used: "none", "prior_period", or "prior_year" | |
| periodRange | No | Date range for the current period data | |
| warningCode | No | Warning code for programmatic handling | |
| comparisonError | No | Error message if comparison data could not be fetched (current period data still returned) | |
| timeAggregation | No | Time aggregation level applied to the data (e.g., "total", "monthly", "daily") | |
| priorPeriodRange | No | Date range for the prior period (present when compare_with is specified) |