{
  "openapi": "3.1.0",
  "info": {
    "title": "Echora API-data",
    "version": "1.0.0",
    "description": "Keyword-based access to seven data sources. Use X-API-Key with an active account. Keyword quotas and monthly changes apply per source; GET requests have no subscription quota. First data request: start/end/limit. Next page: cursor only, on the same source and keyword path. All examples are synthetic. Use your assigned API host and configured keyword paths."
  },
  "paths": {
    "/v1/account/info": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Get account information and quotas",
        "description": "Account expiry, per-source quota and current Jakarta calendar-month usage.",
        "operationId": "account_v1_account_info_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountResponse"
                },
                "example": {
                  "id": 42,
                  "name": "Example Client",
                  "email": "developer@example.invalid",
                  "is_active": true,
                  "expired_at": "2026-12-31",
                  "monthly_change_limit": 2,
                  "sources": [
                    {
                      "source_key": "news",
                      "keyword_limit": 1,
                      "occupied": 1,
                      "active": 1,
                      "changes_used": 0,
                      "changes_max": 2,
                      "changes_remaining": 2
                    },
                    {
                      "source_key": "twitter",
                      "keyword_limit": 1,
                      "occupied": 1,
                      "active": 1,
                      "changes_used": 0,
                      "changes_max": 2,
                      "changes_remaining": 2
                    },
                    {
                      "source_key": "instagram",
                      "keyword_limit": 1,
                      "occupied": 1,
                      "active": 1,
                      "changes_used": 0,
                      "changes_max": 2,
                      "changes_remaining": 2
                    },
                    {
                      "source_key": "threads",
                      "keyword_limit": 1,
                      "occupied": 1,
                      "active": 1,
                      "changes_used": 0,
                      "changes_max": 2,
                      "changes_remaining": 2
                    },
                    {
                      "source_key": "youtube",
                      "keyword_limit": 1,
                      "occupied": 1,
                      "active": 1,
                      "changes_used": 0,
                      "changes_max": 2,
                      "changes_remaining": 2
                    },
                    {
                      "source_key": "tiktok",
                      "keyword_limit": 1,
                      "occupied": 1,
                      "active": 1,
                      "changes_used": 0,
                      "changes_max": 2,
                      "changes_remaining": 2
                    },
                    {
                      "source_key": "facebook",
                      "keyword_limit": 1,
                      "occupied": 1,
                      "active": 1,
                      "changes_used": 0,
                      "changes_max": 2,
                      "changes_remaining": 2
                    }
                  ],
                  "period": "2026-11",
                  "timezone": "Asia/Jakarta"
                }
              }
            }
          },
          "401": {
            "description": "Supply your API key in the X-API-Key header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "missing_api_key",
                    "message": "Supply your API key in the X-API-Key header."
                  }
                }
              }
            }
          },
          "403": {
            "description": "Account is inactive or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "account_unavailable",
                    "message": "Account is inactive or expired."
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "validation_error",
                    "message": "Invalid request parameters."
                  }
                }
              }
            }
          },
          "503": {
            "description": "Account service is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "service_unavailable",
                    "message": "Account service is unavailable."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/v1/keywords": {
      "get": {
        "tags": [
          "Keywords"
        ],
        "summary": "List keyword slots by source",
        "description": "Account keyword slots grouped by source, including empty source arrays.",
        "operationId": "keywords_v1_keywords_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeywordList"
                },
                "example": {
                  "data": {
                    "news": [
                      {
                        "id": 101,
                        "account_id": 42,
                        "source_key": "news",
                        "slot_number": 1,
                        "term_value": "PSSI",
                        "normalized_value": "pssi",
                        "path": "pssi",
                        "is_active": true,
                        "initialized_at": "2026-11-19T02:00:00Z",
                        "revision": 2,
                        "created_at": "2026-11-19T02:00:00Z",
                        "updated_at": "2026-11-19T02:00:00Z",
                        "within_quota": true
                      }
                    ],
                    "twitter": [],
                    "instagram": [],
                    "threads": [],
                    "youtube": [],
                    "tiktok": [],
                    "facebook": []
                  }
                }
              }
            }
          },
          "401": {
            "description": "Supply your API key in the X-API-Key header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "missing_api_key",
                    "message": "Supply your API key in the X-API-Key header."
                  }
                }
              }
            }
          },
          "403": {
            "description": "Account is inactive or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "account_unavailable",
                    "message": "Account is inactive or expired."
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "validation_error",
                    "message": "Invalid request parameters."
                  }
                }
              }
            }
          },
          "503": {
            "description": "Account service is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "service_unavailable",
                    "message": "Account service is unavailable."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      },
      "post": {
        "tags": [
          "Keywords"
        ],
        "summary": "Create a keyword",
        "description": "Fill a source slot. First input per slot is free; refilling a used slot consumes one change.",
        "operationId": "create_v1_keywords_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKeyword"
              },
              "example": {
                "source": "news",
                "keyword": "PSSI"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeywordResponse"
                },
                "example": {
                  "id": 101,
                  "account_id": 42,
                  "source_key": "news",
                  "slot_number": 1,
                  "term_value": "PSSI",
                  "normalized_value": "pssi",
                  "path": "pssi",
                  "is_active": true,
                  "initialized_at": "2026-11-19T02:00:00Z",
                  "revision": 2,
                  "created_at": "2026-11-19T02:00:00Z",
                  "updated_at": "2026-11-19T02:00:00Z",
                  "within_quota": true
                }
              }
            }
          },
          "422": {
            "description": "Invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "validation_error",
                    "message": "Invalid request parameters."
                  }
                }
              }
            }
          },
          "401": {
            "description": "Supply your API key in the X-API-Key header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "missing_api_key",
                    "message": "Supply your API key in the X-API-Key header."
                  }
                }
              }
            }
          },
          "403": {
            "description": "Account is inactive or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "account_unavailable",
                    "message": "Account is inactive or expired."
                  }
                }
              }
            }
          },
          "503": {
            "description": "Account service is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "service_unavailable",
                    "message": "Account service is unavailable."
                  }
                }
              }
            }
          },
          "409": {
            "description": "Monthly changes exhausted. Ask an operator to increase the maximum.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "monthly_change_limit_reached",
                    "message": "Monthly changes exhausted. Ask an operator to increase the maximum."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/v1/keywords/{slot_id}": {
      "patch": {
        "tags": [
          "Keywords"
        ],
        "summary": "Edit a keyword",
        "description": "Edit keyword text. A changed value consumes one monthly source change.",
        "operationId": "update_v1_keywords__slot_id__patch",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "slot_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "title": "Slot Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateKeyword"
              },
              "example": {
                "keyword": "Persija"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeywordResponse"
                },
                "example": {
                  "id": 101,
                  "account_id": 42,
                  "source_key": "news",
                  "slot_number": 1,
                  "term_value": "Persija",
                  "normalized_value": "persija",
                  "path": "persija",
                  "is_active": true,
                  "initialized_at": "2026-11-19T02:00:00Z",
                  "revision": 3,
                  "created_at": "2026-11-19T02:00:00Z",
                  "updated_at": "2026-11-19T02:00:00Z",
                  "within_quota": true
                }
              }
            }
          },
          "422": {
            "description": "Invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "validation_error",
                    "message": "Invalid request parameters."
                  }
                }
              }
            }
          },
          "401": {
            "description": "Supply your API key in the X-API-Key header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "missing_api_key",
                    "message": "Supply your API key in the X-API-Key header."
                  }
                }
              }
            }
          },
          "403": {
            "description": "Account is inactive or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "account_unavailable",
                    "message": "Account is inactive or expired."
                  }
                }
              }
            }
          },
          "503": {
            "description": "Account service is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "service_unavailable",
                    "message": "Account service is unavailable."
                  }
                }
              }
            }
          },
          "409": {
            "description": "Monthly changes exhausted. Ask an operator to increase the maximum.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "monthly_change_limit_reached",
                    "message": "Monthly changes exhausted. Ask an operator to increase the maximum."
                  }
                }
              }
            }
          },
          "404": {
            "description": "Active keyword not found for this account and source.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "keyword_not_found",
                    "message": "Active keyword not found for this account and source."
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Keywords"
        ],
        "summary": "Delete a keyword",
        "description": "Clear a slot while preserving initial-use and change history. Refilling is charged once.",
        "operationId": "delete_v1_keywords__slot_id__delete",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "slot_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "title": "Slot Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeywordResponse"
                },
                "example": {
                  "id": 101,
                  "account_id": 42,
                  "source_key": "news",
                  "slot_number": 1,
                  "term_value": null,
                  "normalized_value": null,
                  "path": null,
                  "is_active": false,
                  "initialized_at": "2026-11-19T02:00:00Z",
                  "revision": 4,
                  "created_at": "2026-11-19T02:00:00Z",
                  "updated_at": "2026-11-19T02:00:00Z",
                  "within_quota": true
                }
              }
            }
          },
          "422": {
            "description": "Invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "validation_error",
                    "message": "Invalid request parameters."
                  }
                }
              }
            }
          },
          "401": {
            "description": "Supply your API key in the X-API-Key header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "missing_api_key",
                    "message": "Supply your API key in the X-API-Key header."
                  }
                }
              }
            }
          },
          "403": {
            "description": "Account is inactive or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "account_unavailable",
                    "message": "Account is inactive or expired."
                  }
                }
              }
            }
          },
          "503": {
            "description": "Account service is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "service_unavailable",
                    "message": "Account service is unavailable."
                  }
                }
              }
            }
          },
          "409": {
            "description": "Monthly changes exhausted. Ask an operator to increase the maximum.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "monthly_change_limit_reached",
                    "message": "Monthly changes exhausted. Ask an operator to increase the maximum."
                  }
                }
              }
            }
          },
          "404": {
            "description": "Active keyword not found for this account and source.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "keyword_not_found",
                    "message": "Active keyword not found for this account and source."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/data/news/{keyword_path}": {
      "get": {
        "tags": [
          "Online News"
        ],
        "summary": "Get Online News data",
        "description": "All matching history for an active keyword. Dates are inclusive Jakarta calendar dates.\n\nFirst request: optional start, end and limit (default 100). Next requests:\nsend only cursor on the same source/path; dates and page size are restored\nfrom its signed payload, without server-side cursor storage. Repeated filters\nare accepted only if identical. No subscription total or GET quota.",
        "operationId": "get_news_data",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "keyword_path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300,
              "title": "Keyword Path"
            },
            "example": "example",
            "description": "Active path from GET /v1/keywords for this source and account."
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive start. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07.",
              "title": "Start"
            },
            "description": "Inclusive start. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07."
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive end. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07.",
              "title": "End"
            },
            "description": "Inclusive end. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 1000,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "First-page size (default 100). With cursor, the original size is restored automatically.",
              "title": "Limit"
            },
            "description": "First-page size (default 100). With cursor, the original size is restored automatically."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 4096
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            },
            "description": "Send only next_cursor from the previous page; initial dates and limit are restored."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataResponseNews"
                },
                "example": {
                  "keyword": {
                    "id": 1,
                    "source": "news",
                    "keyword": "Example",
                    "path": "example"
                  },
                  "data": [
                    {
                      "published_at": "2026-11-18T00:00:00Z",
                      "updated_at": "2026-11-18T00:00:00Z",
                      "source_key": "news",
                      "id": "demo-news",
                      "title": "Example article",
                      "text": "Example news content.",
                      "source": "https://example.invalid/article",
                      "media": "Example Publisher",
                      "image": "https://example.invalid/image.webp",
                      "sentiment": "neutral",
                      "category": "sports"
                    }
                  ],
                  "pagination": {
                    "limit": 100,
                    "has_more": false,
                    "next_cursor": null
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "validation_error",
                    "message": "Invalid request parameters."
                  }
                }
              }
            }
          },
          "401": {
            "description": "Supply your API key in the X-API-Key header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "missing_api_key",
                    "message": "Supply your API key in the X-API-Key header."
                  }
                }
              }
            }
          },
          "403": {
            "description": "Account is inactive or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "account_unavailable",
                    "message": "Account is inactive or expired."
                  }
                }
              }
            }
          },
          "503": {
            "description": "Data service is unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "data_unavailable",
                    "message": "Data service is unavailable. Try again later."
                  }
                }
              }
            }
          },
          "404": {
            "description": "Active keyword not found for this account and source.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "keyword_not_found",
                    "message": "Active keyword not found for this account and source."
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid or incompatible cursor. Start a new data request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "invalid_cursor",
                    "message": "Invalid or incompatible cursor. Start a new data request."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/data/twitter/{keyword_path}": {
      "get": {
        "tags": [
          "X / Twitter"
        ],
        "summary": "Get X / Twitter data",
        "description": "All matching history for an active keyword. Dates are inclusive Jakarta calendar dates.\n\nFirst request: optional start, end and limit (default 100). Next requests:\nsend only cursor on the same source/path; dates and page size are restored\nfrom its signed payload, without server-side cursor storage. Repeated filters\nare accepted only if identical. No subscription total or GET quota.",
        "operationId": "get_twitter_data",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "keyword_path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300,
              "title": "Keyword Path"
            },
            "example": "example",
            "description": "Active path from GET /v1/keywords for this source and account."
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive start. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07.",
              "title": "Start"
            },
            "description": "Inclusive start. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07."
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive end. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07.",
              "title": "End"
            },
            "description": "Inclusive end. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 1000,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "First-page size (default 100). With cursor, the original size is restored automatically.",
              "title": "Limit"
            },
            "description": "First-page size (default 100). With cursor, the original size is restored automatically."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 4096
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            },
            "description": "Send only next_cursor from the previous page; initial dates and limit are restored."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataResponseTwitter"
                },
                "example": {
                  "keyword": {
                    "id": 1,
                    "source": "twitter",
                    "keyword": "Example",
                    "path": "example"
                  },
                  "data": [
                    {
                      "source_key": "twitter",
                      "id": "demo-tweet",
                      "created_at": "2026-11-18T00:00:00Z",
                      "updated_at": "2026-11-18T00:00:00Z",
                      "text": "Example tweet.",
                      "source": "",
                      "author": {
                        "username": "example",
                        "name": "Example Author",
                        "profile_image_url": "https://example.invalid/avatar.webp",
                        "public_metrics": {
                          "followers_count": 0
                        }
                      },
                      "public_metrics": {
                        "retweet_count": 3,
                        "reply_count": 2,
                        "like_count": 10
                      },
                      "hashtags": [],
                      "mentions": [],
                      "retweeted_user": null,
                      "retweeted_id": null,
                      "retweeted_profile_image_url": null,
                      "is_retweet": false,
                      "media": [
                        {
                          "type": "photo",
                          "url": "https://example.invalid/photo.webp"
                        }
                      ],
                      "sentiment": "neutral",
                      "gender": "",
                      "url": "https://x.com/example/status/demo-tweet"
                    }
                  ],
                  "pagination": {
                    "limit": 100,
                    "has_more": false,
                    "next_cursor": null
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "validation_error",
                    "message": "Invalid request parameters."
                  }
                }
              }
            }
          },
          "401": {
            "description": "Supply your API key in the X-API-Key header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "missing_api_key",
                    "message": "Supply your API key in the X-API-Key header."
                  }
                }
              }
            }
          },
          "403": {
            "description": "Account is inactive or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "account_unavailable",
                    "message": "Account is inactive or expired."
                  }
                }
              }
            }
          },
          "503": {
            "description": "Data service is unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "data_unavailable",
                    "message": "Data service is unavailable. Try again later."
                  }
                }
              }
            }
          },
          "404": {
            "description": "Active keyword not found for this account and source.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "keyword_not_found",
                    "message": "Active keyword not found for this account and source."
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid or incompatible cursor. Start a new data request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "invalid_cursor",
                    "message": "Invalid or incompatible cursor. Start a new data request."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/data/instagram/{keyword_path}": {
      "get": {
        "tags": [
          "Instagram"
        ],
        "summary": "Get Instagram data",
        "description": "All matching history for an active keyword. Dates are inclusive Jakarta calendar dates.\n\nFirst request: optional start, end and limit (default 100). Next requests:\nsend only cursor on the same source/path; dates and page size are restored\nfrom its signed payload, without server-side cursor storage. Repeated filters\nare accepted only if identical. No subscription total or GET quota.",
        "operationId": "get_instagram_data",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "keyword_path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300,
              "title": "Keyword Path"
            },
            "example": "example",
            "description": "Active path from GET /v1/keywords for this source and account."
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive start. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07.",
              "title": "Start"
            },
            "description": "Inclusive start. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07."
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive end. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07.",
              "title": "End"
            },
            "description": "Inclusive end. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 1000,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "First-page size (default 100). With cursor, the original size is restored automatically.",
              "title": "Limit"
            },
            "description": "First-page size (default 100). With cursor, the original size is restored automatically."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 4096
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            },
            "description": "Send only next_cursor from the previous page; initial dates and limit are restored."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataResponseInstagram"
                },
                "example": {
                  "keyword": {
                    "id": 1,
                    "source": "instagram",
                    "keyword": "Example",
                    "path": "example"
                  },
                  "data": [
                    {
                      "source_key": "instagram",
                      "id": "demo-instagram",
                      "shortcode": "demo",
                      "caption": "Example caption.",
                      "timestamp": "2026-11-18T00:00:00Z",
                      "updated_at": "2026-11-18T00:00:00Z",
                      "permalink": "https://www.instagram.com/p/demo/",
                      "author": {
                        "id": null,
                        "username": "example",
                        "name": "Example Author",
                        "profile_picture_url": "https://example.invalid/avatar.webp",
                        "public_metrics": {
                          "followers_count": 100
                        }
                      },
                      "public_metrics": {
                        "like_count": 10,
                        "comments_count": 0
                      },
                      "media": [
                        {
                          "type": "photo",
                          "url": "https://example.invalid/photo.webp"
                        }
                      ],
                      "location": null,
                      "hashtags": [
                        "example"
                      ],
                      "mentions": [],
                      "tagged_users": [],
                      "sentiment": "neutral",
                      "gender": ""
                    }
                  ],
                  "pagination": {
                    "limit": 100,
                    "has_more": false,
                    "next_cursor": null
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "validation_error",
                    "message": "Invalid request parameters."
                  }
                }
              }
            }
          },
          "401": {
            "description": "Supply your API key in the X-API-Key header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "missing_api_key",
                    "message": "Supply your API key in the X-API-Key header."
                  }
                }
              }
            }
          },
          "403": {
            "description": "Account is inactive or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "account_unavailable",
                    "message": "Account is inactive or expired."
                  }
                }
              }
            }
          },
          "503": {
            "description": "Data service is unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "data_unavailable",
                    "message": "Data service is unavailable. Try again later."
                  }
                }
              }
            }
          },
          "404": {
            "description": "Active keyword not found for this account and source.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "keyword_not_found",
                    "message": "Active keyword not found for this account and source."
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid or incompatible cursor. Start a new data request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "invalid_cursor",
                    "message": "Invalid or incompatible cursor. Start a new data request."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/data/threads/{keyword_path}": {
      "get": {
        "tags": [
          "Threads"
        ],
        "summary": "Get Threads data",
        "description": "All matching history for an active keyword. Dates are inclusive Jakarta calendar dates.\n\nFirst request: optional start, end and limit (default 100). Next requests:\nsend only cursor on the same source/path; dates and page size are restored\nfrom its signed payload, without server-side cursor storage. Repeated filters\nare accepted only if identical. No subscription total or GET quota.",
        "operationId": "get_threads_data",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "keyword_path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300,
              "title": "Keyword Path"
            },
            "example": "example",
            "description": "Active path from GET /v1/keywords for this source and account."
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive start. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07.",
              "title": "Start"
            },
            "description": "Inclusive start. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07."
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive end. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07.",
              "title": "End"
            },
            "description": "Inclusive end. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 1000,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "First-page size (default 100). With cursor, the original size is restored automatically.",
              "title": "Limit"
            },
            "description": "First-page size (default 100). With cursor, the original size is restored automatically."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 4096
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            },
            "description": "Send only next_cursor from the previous page; initial dates and limit are restored."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataResponseThreads"
                },
                "example": {
                  "keyword": {
                    "id": 1,
                    "source": "threads",
                    "keyword": "Example",
                    "path": "example"
                  },
                  "data": [
                    {
                      "source_key": "threads",
                      "id": "demo-threads",
                      "shortcode": "demo",
                      "text": "Example Threads post.",
                      "timestamp": "2026-11-18T00:00:00Z",
                      "updated_at": "2026-11-18T00:00:00Z",
                      "permalink": "https://www.threads.com/@example/post/demo",
                      "author": {
                        "id": null,
                        "username": "example",
                        "name": "Example Author",
                        "profile_picture_url": "https://example.invalid/avatar.webp",
                        "verified": false
                      },
                      "public_metrics": {
                        "like_count": 10,
                        "reply_count": 2,
                        "repost_count": 1,
                        "quote_count": 0,
                        "reshare_count": 1
                      },
                      "media": [
                        {
                          "type": "photo",
                          "url": "https://example.invalid/photo.webp"
                        }
                      ],
                      "is_reply": false,
                      "reply_to_post_id": null,
                      "reply_to_username": null,
                      "hashtags": [
                        "example"
                      ],
                      "mentions": [],
                      "sentiment": "neutral",
                      "gender": ""
                    }
                  ],
                  "pagination": {
                    "limit": 100,
                    "has_more": false,
                    "next_cursor": null
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "validation_error",
                    "message": "Invalid request parameters."
                  }
                }
              }
            }
          },
          "401": {
            "description": "Supply your API key in the X-API-Key header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "missing_api_key",
                    "message": "Supply your API key in the X-API-Key header."
                  }
                }
              }
            }
          },
          "403": {
            "description": "Account is inactive or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "account_unavailable",
                    "message": "Account is inactive or expired."
                  }
                }
              }
            }
          },
          "503": {
            "description": "Data service is unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "data_unavailable",
                    "message": "Data service is unavailable. Try again later."
                  }
                }
              }
            }
          },
          "404": {
            "description": "Active keyword not found for this account and source.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "keyword_not_found",
                    "message": "Active keyword not found for this account and source."
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid or incompatible cursor. Start a new data request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "invalid_cursor",
                    "message": "Invalid or incompatible cursor. Start a new data request."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/data/youtube/{keyword_path}": {
      "get": {
        "tags": [
          "YouTube"
        ],
        "summary": "Get YouTube data",
        "description": "All matching history for an active keyword. Dates are inclusive Jakarta calendar dates.\n\nFirst request: optional start, end and limit (default 100). Next requests:\nsend only cursor on the same source/path; dates and page size are restored\nfrom its signed payload, without server-side cursor storage. Repeated filters\nare accepted only if identical. No subscription total or GET quota.",
        "operationId": "get_youtube_data",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "keyword_path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300,
              "title": "Keyword Path"
            },
            "example": "example",
            "description": "Active path from GET /v1/keywords for this source and account."
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive start. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07.",
              "title": "Start"
            },
            "description": "Inclusive start. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07."
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive end. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07.",
              "title": "End"
            },
            "description": "Inclusive end. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 1000,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "First-page size (default 100). With cursor, the original size is restored automatically.",
              "title": "Limit"
            },
            "description": "First-page size (default 100). With cursor, the original size is restored automatically."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 4096
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            },
            "description": "Send only next_cursor from the previous page; initial dates and limit are restored."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataResponseYoutube"
                },
                "example": {
                  "keyword": {
                    "id": 1,
                    "source": "youtube",
                    "keyword": "Example",
                    "path": "example"
                  },
                  "data": [
                    {
                      "source_key": "youtube",
                      "id": "demo-video",
                      "title": "Example video",
                      "description": "Example description.",
                      "published_at": "2026-11-18T00:00:00Z",
                      "updated_at": "2026-11-18T00:00:00Z",
                      "url": "https://www.youtube.com/watch?v=demo-video",
                      "embed_url": "https://www.youtube.com/embed/demo-video",
                      "thumbnail_url": "https://example.invalid/thumbnail.webp",
                      "channel": {
                        "id": "demo-channel",
                        "title": "Example Channel",
                        "thumbnail_url": "https://example.invalid/avatar.webp"
                      },
                      "public_metrics": {
                        "view_count": 100,
                        "like_count": 10,
                        "comment_count": 0
                      },
                      "duration_seconds": 120,
                      "tags": [],
                      "categories": [
                        "Sports"
                      ],
                      "sentiment": "neutral"
                    }
                  ],
                  "pagination": {
                    "limit": 100,
                    "has_more": false,
                    "next_cursor": null
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "validation_error",
                    "message": "Invalid request parameters."
                  }
                }
              }
            }
          },
          "401": {
            "description": "Supply your API key in the X-API-Key header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "missing_api_key",
                    "message": "Supply your API key in the X-API-Key header."
                  }
                }
              }
            }
          },
          "403": {
            "description": "Account is inactive or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "account_unavailable",
                    "message": "Account is inactive or expired."
                  }
                }
              }
            }
          },
          "503": {
            "description": "Data service is unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "data_unavailable",
                    "message": "Data service is unavailable. Try again later."
                  }
                }
              }
            }
          },
          "404": {
            "description": "Active keyword not found for this account and source.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "keyword_not_found",
                    "message": "Active keyword not found for this account and source."
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid or incompatible cursor. Start a new data request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "invalid_cursor",
                    "message": "Invalid or incompatible cursor. Start a new data request."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/data/tiktok/{keyword_path}": {
      "get": {
        "tags": [
          "TikTok"
        ],
        "summary": "Get TikTok data",
        "description": "All matching history for an active keyword. Dates are inclusive Jakarta calendar dates.\n\nFirst request: optional start, end and limit (default 100). Next requests:\nsend only cursor on the same source/path; dates and page size are restored\nfrom its signed payload, without server-side cursor storage. Repeated filters\nare accepted only if identical. No subscription total or GET quota.",
        "operationId": "get_tiktok_data",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "keyword_path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300,
              "title": "Keyword Path"
            },
            "example": "example",
            "description": "Active path from GET /v1/keywords for this source and account."
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive start. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07.",
              "title": "Start"
            },
            "description": "Inclusive start. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07."
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive end. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07.",
              "title": "End"
            },
            "description": "Inclusive end. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 1000,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "First-page size (default 100). With cursor, the original size is restored automatically.",
              "title": "Limit"
            },
            "description": "First-page size (default 100). With cursor, the original size is restored automatically."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 4096
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            },
            "description": "Send only next_cursor from the previous page; initial dates and limit are restored."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataResponseTiktok"
                },
                "example": {
                  "keyword": {
                    "id": 1,
                    "source": "tiktok",
                    "keyword": "Example",
                    "path": "example"
                  },
                  "data": [
                    {
                      "source_key": "tiktok",
                      "id": "demo-tiktok",
                      "description": "Example video.",
                      "created_at": "2026-11-18T00:00:00Z",
                      "updated_at": "2026-11-18T00:00:00Z",
                      "url": "https://www.tiktok.com/@example/video/demo-tiktok",
                      "author": {
                        "id": null,
                        "username": "example",
                        "name": "Example Author",
                        "profile_image_url": "https://example.invalid/avatar.webp",
                        "bio": "",
                        "verified": false
                      },
                      "public_metrics": {
                        "view_count": 100,
                        "like_count": 10,
                        "comment_count": 0,
                        "share_count": 0,
                        "favorites_count": 0
                      },
                      "media": [
                        {
                          "type": "video",
                          "url": "https://example.invalid/video.mp4",
                          "cover_image_url": "https://example.invalid/cover.webp",
                          "duration_seconds": 30,
                          "width": null,
                          "height": null,
                          "resolution": null
                        }
                      ],
                      "music": {
                        "id": "demo-music",
                        "title": "Example music",
                        "author_name": "Example Artist",
                        "duration_seconds": 60,
                        "play_url": "https://example.invalid/music.mp3",
                        "cover_image_url": "https://example.invalid/music.webp",
                        "is_original": true,
                        "album": "",
                        "is_copyrighted": false
                      },
                      "sentiment": "neutral",
                      "gender": ""
                    }
                  ],
                  "pagination": {
                    "limit": 100,
                    "has_more": false,
                    "next_cursor": null
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "validation_error",
                    "message": "Invalid request parameters."
                  }
                }
              }
            }
          },
          "401": {
            "description": "Supply your API key in the X-API-Key header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "missing_api_key",
                    "message": "Supply your API key in the X-API-Key header."
                  }
                }
              }
            }
          },
          "403": {
            "description": "Account is inactive or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "account_unavailable",
                    "message": "Account is inactive or expired."
                  }
                }
              }
            }
          },
          "503": {
            "description": "Data service is unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "data_unavailable",
                    "message": "Data service is unavailable. Try again later."
                  }
                }
              }
            }
          },
          "404": {
            "description": "Active keyword not found for this account and source.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "keyword_not_found",
                    "message": "Active keyword not found for this account and source."
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid or incompatible cursor. Start a new data request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "invalid_cursor",
                    "message": "Invalid or incompatible cursor. Start a new data request."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/data/facebook/{keyword_path}": {
      "get": {
        "tags": [
          "Facebook"
        ],
        "summary": "Get Facebook data",
        "description": "All matching history for an active keyword. Dates are inclusive Jakarta calendar dates.\n\nFirst request: optional start, end and limit (default 100). Next requests:\nsend only cursor on the same source/path; dates and page size are restored\nfrom its signed payload, without server-side cursor storage. Repeated filters\nare accepted only if identical. No subscription total or GET quota.",
        "operationId": "get_facebook_data",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "keyword_path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300,
              "title": "Keyword Path"
            },
            "example": "example",
            "description": "Active path from GET /v1/keywords for this source and account."
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive start. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07.",
              "title": "Start"
            },
            "description": "Inclusive start. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07."
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive end. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07.",
              "title": "End"
            },
            "description": "Inclusive end. Asia/Jakarta calendar date (YYYY-MM-DD), from 1970-01-01 through 2106-02-07."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 1000,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "First-page size (default 100). With cursor, the original size is restored automatically.",
              "title": "Limit"
            },
            "description": "First-page size (default 100). With cursor, the original size is restored automatically."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 4096
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            },
            "description": "Send only next_cursor from the previous page; initial dates and limit are restored."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataResponseFacebook"
                },
                "example": {
                  "keyword": {
                    "id": 1,
                    "source": "facebook",
                    "keyword": "Example",
                    "path": "example"
                  },
                  "data": [
                    {
                      "source_key": "facebook",
                      "id": "1234567890",
                      "message": "Example Facebook post.",
                      "created_time": "2026-11-18T00:00:00Z",
                      "updated_at": "2026-11-18T00:00:00Z",
                      "permalink_url": "https://www.facebook.com/1234567890",
                      "from": {
                        "id": "9876543210",
                        "name": "Example Page",
                        "username": "example",
                        "link": "https://www.facebook.com/example"
                      },
                      "public_metrics": {
                        "reaction_count": 10,
                        "comment_count": 2,
                        "share_count": 1
                      },
                      "reactions": [
                        {
                          "id": "like",
                          "name": "Like",
                          "count": 10
                        }
                      ],
                      "sentiment": "neutral",
                      "category": "sports"
                    }
                  ],
                  "pagination": {
                    "limit": 100,
                    "has_more": false,
                    "next_cursor": null
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "validation_error",
                    "message": "Invalid request parameters."
                  }
                }
              }
            }
          },
          "401": {
            "description": "Supply your API key in the X-API-Key header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "missing_api_key",
                    "message": "Supply your API key in the X-API-Key header."
                  }
                }
              }
            }
          },
          "403": {
            "description": "Account is inactive or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "account_unavailable",
                    "message": "Account is inactive or expired."
                  }
                }
              }
            }
          },
          "503": {
            "description": "Data service is unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "data_unavailable",
                    "message": "Data service is unavailable. Try again later."
                  }
                }
              }
            }
          },
          "404": {
            "description": "Active keyword not found for this account and source.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "keyword_not_found",
                    "message": "Active keyword not found for this account and source."
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid or incompatible cursor. Start a new data request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                },
                "example": {
                  "error": {
                    "code": "invalid_cursor",
                    "message": "Invalid or incompatible cursor. Start a new data request."
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AccountResponse": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "expired_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expired At"
          },
          "monthly_change_limit": {
            "type": "integer",
            "title": "Monthly Change Limit"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/SourceQuota"
            },
            "type": "array",
            "title": "Sources"
          },
          "period": {
            "type": "string",
            "title": "Period"
          },
          "timezone": {
            "type": "string",
            "title": "Timezone"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "email",
          "is_active",
          "expired_at",
          "monthly_change_limit",
          "sources",
          "period",
          "timezone"
        ],
        "title": "AccountResponse"
      },
      "CreateKeyword": {
        "properties": {
          "source": {
            "$ref": "#/components/schemas/Source"
          },
          "keyword": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Keyword"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "source",
          "keyword"
        ],
        "title": "CreateKeyword"
      },
      "DataKeyword": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "source": {
            "$ref": "#/components/schemas/Source"
          },
          "keyword": {
            "type": "string",
            "title": "Keyword"
          },
          "path": {
            "type": "string",
            "title": "Path"
          }
        },
        "type": "object",
        "required": [
          "id",
          "source",
          "keyword",
          "path"
        ],
        "title": "DataKeyword"
      },
      "FacebookAuthor": {
        "properties": {
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "username": {
            "type": "string",
            "title": "Username"
          },
          "link": {
            "type": "string",
            "title": "Link",
            "description": "Absolute Page URL, or an empty string."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "name",
          "username",
          "link"
        ],
        "title": "FacebookAuthor"
      },
      "FacebookMention": {
        "properties": {
          "source_key": {
            "type": "string",
            "const": "facebook",
            "title": "Source Key"
          },
          "id": {
            "type": "string",
            "title": "Id"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "created_time": {
            "type": "string",
            "format": "date-time",
            "title": "Created Time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "permalink_url": {
            "type": "string",
            "title": "Permalink Url"
          },
          "from": {
            "$ref": "#/components/schemas/FacebookAuthor"
          },
          "public_metrics": {
            "$ref": "#/components/schemas/FacebookPublicMetrics"
          },
          "reactions": {
            "items": {
              "$ref": "#/components/schemas/FacebookReaction"
            },
            "type": "array",
            "title": "Reactions",
            "description": "Stored reaction breakdown; may be partial, not a list of people."
          },
          "sentiment": {
            "type": "string",
            "title": "Sentiment"
          },
          "category": {
            "type": "string",
            "title": "Category"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "source_key",
          "id",
          "message",
          "created_time",
          "updated_at",
          "permalink_url",
          "from",
          "public_metrics",
          "reactions",
          "sentiment",
          "category"
        ],
        "title": "FacebookMention"
      },
      "FacebookPublicMetrics": {
        "properties": {
          "reaction_count": {
            "type": "integer",
            "title": "Reaction Count"
          },
          "comment_count": {
            "type": "integer",
            "title": "Comment Count"
          },
          "share_count": {
            "type": "integer",
            "title": "Share Count"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "reaction_count",
          "comment_count",
          "share_count"
        ],
        "title": "FacebookPublicMetrics"
      },
      "FacebookReaction": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "name",
          "count"
        ],
        "title": "FacebookReaction"
      },
      "InstagramAuthor": {
        "properties": {
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id",
            "description": "Stored Instagram user ID, or null if unavailable."
          },
          "username": {
            "type": "string",
            "title": "Username"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "profile_picture_url": {
            "type": "string",
            "title": "Profile Picture Url"
          },
          "public_metrics": {
            "$ref": "#/components/schemas/InstagramAuthorMetrics"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "username",
          "name",
          "profile_picture_url",
          "public_metrics"
        ],
        "title": "InstagramAuthor"
      },
      "InstagramAuthorMetrics": {
        "properties": {
          "followers_count": {
            "type": "integer",
            "title": "Followers Count"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "followers_count"
        ],
        "title": "InstagramAuthorMetrics"
      },
      "InstagramLocation": {
        "properties": {
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "City"
          },
          "longitude": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Longitude"
          },
          "latitude": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latitude"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "name",
          "address",
          "city",
          "longitude",
          "latitude"
        ],
        "title": "InstagramLocation"
      },
      "InstagramMedia": {
        "properties": {
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type",
            "description": "Stored photo/video type, or null if unavailable."
          },
          "url": {
            "type": "string",
            "title": "Url",
            "description": "Absolute media URL."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "type",
          "url"
        ],
        "title": "InstagramMedia"
      },
      "InstagramMention": {
        "properties": {
          "source_key": {
            "type": "string",
            "const": "instagram",
            "title": "Source Key"
          },
          "id": {
            "type": "string",
            "title": "Id"
          },
          "shortcode": {
            "type": "string",
            "title": "Shortcode"
          },
          "caption": {
            "type": "string",
            "title": "Caption"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "title": "Timestamp"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "permalink": {
            "type": "string",
            "title": "Permalink"
          },
          "author": {
            "$ref": "#/components/schemas/InstagramAuthor"
          },
          "public_metrics": {
            "$ref": "#/components/schemas/InstagramPublicMetrics"
          },
          "media": {
            "items": {
              "$ref": "#/components/schemas/InstagramMedia"
            },
            "type": "array",
            "title": "Media"
          },
          "location": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InstagramLocation"
              },
              {
                "type": "null"
              }
            ]
          },
          "hashtags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Hashtags"
          },
          "mentions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Mentions"
          },
          "tagged_users": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tagged Users"
          },
          "sentiment": {
            "type": "string",
            "title": "Sentiment"
          },
          "gender": {
            "type": "string",
            "title": "Gender"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "source_key",
          "id",
          "shortcode",
          "caption",
          "timestamp",
          "updated_at",
          "permalink",
          "author",
          "public_metrics",
          "media",
          "location",
          "hashtags",
          "mentions",
          "tagged_users",
          "sentiment",
          "gender"
        ],
        "title": "InstagramMention"
      },
      "InstagramPublicMetrics": {
        "properties": {
          "like_count": {
            "type": "integer",
            "title": "Like Count"
          },
          "comments_count": {
            "type": "integer",
            "title": "Comments Count"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "like_count",
          "comments_count"
        ],
        "title": "InstagramPublicMetrics"
      },
      "KeywordGroups": {
        "properties": {
          "news": {
            "items": {
              "$ref": "#/components/schemas/KeywordResponse"
            },
            "type": "array",
            "title": "News"
          },
          "twitter": {
            "items": {
              "$ref": "#/components/schemas/KeywordResponse"
            },
            "type": "array",
            "title": "Twitter"
          },
          "instagram": {
            "items": {
              "$ref": "#/components/schemas/KeywordResponse"
            },
            "type": "array",
            "title": "Instagram"
          },
          "threads": {
            "items": {
              "$ref": "#/components/schemas/KeywordResponse"
            },
            "type": "array",
            "title": "Threads"
          },
          "youtube": {
            "items": {
              "$ref": "#/components/schemas/KeywordResponse"
            },
            "type": "array",
            "title": "Youtube"
          },
          "tiktok": {
            "items": {
              "$ref": "#/components/schemas/KeywordResponse"
            },
            "type": "array",
            "title": "Tiktok"
          },
          "facebook": {
            "items": {
              "$ref": "#/components/schemas/KeywordResponse"
            },
            "type": "array",
            "title": "Facebook"
          }
        },
        "type": "object",
        "required": [
          "news",
          "twitter",
          "instagram",
          "threads",
          "youtube",
          "tiktok",
          "facebook"
        ],
        "title": "KeywordGroups"
      },
      "KeywordList": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/KeywordGroups"
          }
        },
        "type": "object",
        "required": [
          "data"
        ],
        "title": "KeywordList"
      },
      "KeywordResponse": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "account_id": {
            "type": "integer",
            "title": "Account Id"
          },
          "source_key": {
            "$ref": "#/components/schemas/Source"
          },
          "slot_number": {
            "type": "integer",
            "title": "Slot Number"
          },
          "term_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Term Value"
          },
          "normalized_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Normalized Value"
          },
          "path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Path"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "initialized_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Initialized At"
          },
          "revision": {
            "type": "integer",
            "title": "Revision"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "within_quota": {
            "type": "boolean",
            "title": "Within Quota",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "id",
          "account_id",
          "source_key",
          "slot_number",
          "term_value",
          "normalized_value",
          "path",
          "is_active",
          "initialized_at",
          "revision",
          "created_at",
          "updated_at"
        ],
        "title": "KeywordResponse"
      },
      "NewsMention": {
        "properties": {
          "published_at": {
            "type": "string",
            "format": "date-time",
            "title": "Published At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "source_key": {
            "type": "string",
            "const": "news",
            "title": "Source Key"
          },
          "id": {
            "type": "string",
            "title": "Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "text": {
            "type": "string",
            "title": "Text"
          },
          "source": {
            "type": "string",
            "title": "Source",
            "description": "Absolute article URL."
          },
          "media": {
            "type": "string",
            "title": "Media",
            "description": "Publisher name, as stored in the News source."
          },
          "image": {
            "type": "string",
            "title": "Image",
            "description": "Absolute image URL, or an empty string."
          },
          "sentiment": {
            "type": "string",
            "title": "Sentiment"
          },
          "category": {
            "type": "string",
            "title": "Category"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "published_at",
          "updated_at",
          "source_key",
          "id",
          "title",
          "text",
          "source",
          "media",
          "image",
          "sentiment",
          "category"
        ],
        "title": "NewsMention"
      },
      "Pagination": {
        "properties": {
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "type": "object",
        "required": [
          "limit",
          "has_more",
          "next_cursor"
        ],
        "title": "Pagination"
      },
      "Source": {
        "type": "string",
        "enum": [
          "news",
          "twitter",
          "instagram",
          "threads",
          "youtube",
          "tiktok",
          "facebook"
        ],
        "title": "Source"
      },
      "SourceQuota": {
        "properties": {
          "source_key": {
            "$ref": "#/components/schemas/Source"
          },
          "keyword_limit": {
            "type": "integer",
            "title": "Keyword Limit"
          },
          "occupied": {
            "type": "integer",
            "title": "Occupied"
          },
          "active": {
            "type": "integer",
            "title": "Active"
          },
          "changes_used": {
            "type": "integer",
            "title": "Changes Used"
          },
          "changes_max": {
            "type": "integer",
            "title": "Changes Max"
          },
          "changes_remaining": {
            "type": "integer",
            "title": "Changes Remaining"
          }
        },
        "type": "object",
        "required": [
          "source_key",
          "keyword_limit",
          "occupied",
          "active",
          "changes_used",
          "changes_max",
          "changes_remaining"
        ],
        "title": "SourceQuota"
      },
      "ThreadsAuthor": {
        "properties": {
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id",
            "description": "Stored Threads user ID, or null if unavailable."
          },
          "username": {
            "type": "string",
            "title": "Username"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "profile_picture_url": {
            "type": "string",
            "title": "Profile Picture Url"
          },
          "verified": {
            "type": "boolean",
            "title": "Verified"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "username",
          "name",
          "profile_picture_url",
          "verified"
        ],
        "title": "ThreadsAuthor"
      },
      "ThreadsMedia": {
        "properties": {
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type",
            "description": "Stored photo/video type, or null if unavailable."
          },
          "url": {
            "type": "string",
            "title": "Url",
            "description": "Absolute media URL."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "type",
          "url"
        ],
        "title": "ThreadsMedia"
      },
      "ThreadsMention": {
        "properties": {
          "source_key": {
            "type": "string",
            "const": "threads",
            "title": "Source Key"
          },
          "id": {
            "type": "string",
            "title": "Id"
          },
          "shortcode": {
            "type": "string",
            "title": "Shortcode"
          },
          "text": {
            "type": "string",
            "title": "Text"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "title": "Timestamp"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "permalink": {
            "type": "string",
            "title": "Permalink"
          },
          "author": {
            "$ref": "#/components/schemas/ThreadsAuthor"
          },
          "public_metrics": {
            "$ref": "#/components/schemas/ThreadsPublicMetrics"
          },
          "media": {
            "items": {
              "$ref": "#/components/schemas/ThreadsMedia"
            },
            "type": "array",
            "title": "Media"
          },
          "is_reply": {
            "type": "boolean",
            "title": "Is Reply"
          },
          "reply_to_post_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reply To Post Id"
          },
          "reply_to_username": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reply To Username"
          },
          "hashtags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Hashtags"
          },
          "mentions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Mentions"
          },
          "sentiment": {
            "type": "string",
            "title": "Sentiment"
          },
          "gender": {
            "type": "string",
            "title": "Gender"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "source_key",
          "id",
          "shortcode",
          "text",
          "timestamp",
          "updated_at",
          "permalink",
          "author",
          "public_metrics",
          "media",
          "is_reply",
          "reply_to_post_id",
          "reply_to_username",
          "hashtags",
          "mentions",
          "sentiment",
          "gender"
        ],
        "title": "ThreadsMention"
      },
      "ThreadsPublicMetrics": {
        "properties": {
          "like_count": {
            "type": "integer",
            "title": "Like Count"
          },
          "reply_count": {
            "type": "integer",
            "title": "Reply Count"
          },
          "repost_count": {
            "type": "integer",
            "title": "Repost Count"
          },
          "quote_count": {
            "type": "integer",
            "title": "Quote Count"
          },
          "reshare_count": {
            "type": "integer",
            "title": "Reshare Count"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "like_count",
          "reply_count",
          "repost_count",
          "quote_count",
          "reshare_count"
        ],
        "title": "ThreadsPublicMetrics"
      },
      "TikTokAuthor": {
        "properties": {
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "username": {
            "type": "string",
            "title": "Username"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "profile_image_url": {
            "type": "string",
            "title": "Profile Image Url"
          },
          "bio": {
            "type": "string",
            "title": "Bio"
          },
          "verified": {
            "type": "boolean",
            "title": "Verified"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "username",
          "name",
          "profile_image_url",
          "bio",
          "verified"
        ],
        "title": "TikTokAuthor"
      },
      "TikTokMedia": {
        "properties": {
          "type": {
            "type": "string",
            "const": "video",
            "title": "Type"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "cover_image_url": {
            "type": "string",
            "title": "Cover Image Url"
          },
          "duration_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Seconds"
          },
          "width": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Width"
          },
          "height": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Height"
          },
          "resolution": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolution"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "type",
          "url",
          "cover_image_url",
          "duration_seconds",
          "width",
          "height",
          "resolution"
        ],
        "title": "TikTokMedia"
      },
      "TikTokMention": {
        "properties": {
          "source_key": {
            "type": "string",
            "const": "tiktok",
            "title": "Source Key"
          },
          "id": {
            "type": "string",
            "title": "Id"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "author": {
            "$ref": "#/components/schemas/TikTokAuthor"
          },
          "public_metrics": {
            "$ref": "#/components/schemas/TikTokPublicMetrics"
          },
          "media": {
            "items": {
              "$ref": "#/components/schemas/TikTokMedia"
            },
            "type": "array",
            "title": "Media"
          },
          "music": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TikTokMusic"
              },
              {
                "type": "null"
              }
            ]
          },
          "sentiment": {
            "type": "string",
            "title": "Sentiment"
          },
          "gender": {
            "type": "string",
            "title": "Gender"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "source_key",
          "id",
          "description",
          "created_at",
          "updated_at",
          "url",
          "author",
          "public_metrics",
          "media",
          "music",
          "sentiment",
          "gender"
        ],
        "title": "TikTokMention"
      },
      "TikTokMusic": {
        "properties": {
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "author_name": {
            "type": "string",
            "title": "Author Name"
          },
          "duration_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Seconds"
          },
          "play_url": {
            "type": "string",
            "title": "Play Url"
          },
          "cover_image_url": {
            "type": "string",
            "title": "Cover Image Url"
          },
          "is_original": {
            "type": "boolean",
            "title": "Is Original"
          },
          "album": {
            "type": "string",
            "title": "Album"
          },
          "is_copyrighted": {
            "type": "boolean",
            "title": "Is Copyrighted"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "title",
          "author_name",
          "duration_seconds",
          "play_url",
          "cover_image_url",
          "is_original",
          "album",
          "is_copyrighted"
        ],
        "title": "TikTokMusic"
      },
      "TikTokPublicMetrics": {
        "properties": {
          "view_count": {
            "type": "integer",
            "title": "View Count"
          },
          "like_count": {
            "type": "integer",
            "title": "Like Count"
          },
          "comment_count": {
            "type": "integer",
            "title": "Comment Count"
          },
          "share_count": {
            "type": "integer",
            "title": "Share Count"
          },
          "favorites_count": {
            "type": "integer",
            "title": "Favorites Count"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "view_count",
          "like_count",
          "comment_count",
          "share_count",
          "favorites_count"
        ],
        "title": "TikTokPublicMetrics"
      },
      "TwitterAuthor": {
        "properties": {
          "username": {
            "type": "string",
            "title": "Username"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "profile_image_url": {
            "type": "string",
            "title": "Profile Image Url"
          },
          "public_metrics": {
            "$ref": "#/components/schemas/TwitterAuthorMetrics"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "username",
          "name",
          "profile_image_url",
          "public_metrics"
        ],
        "title": "TwitterAuthor"
      },
      "TwitterAuthorMetrics": {
        "properties": {
          "followers_count": {
            "type": "integer",
            "title": "Followers Count"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "followers_count"
        ],
        "title": "TwitterAuthorMetrics"
      },
      "TwitterMedia": {
        "properties": {
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type",
            "description": "photo, video, animated_gif, or null when the stored type is unavailable."
          },
          "url": {
            "type": "string",
            "title": "Url",
            "description": "Absolute media URL."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "type",
          "url"
        ],
        "title": "TwitterMedia"
      },
      "TwitterMention": {
        "properties": {
          "source_key": {
            "type": "string",
            "const": "twitter",
            "title": "Source Key"
          },
          "id": {
            "type": "string",
            "title": "Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "text": {
            "type": "string",
            "title": "Text"
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "author": {
            "$ref": "#/components/schemas/TwitterAuthor"
          },
          "public_metrics": {
            "$ref": "#/components/schemas/TwitterPublicMetrics"
          },
          "hashtags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Hashtags"
          },
          "mentions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Mentions"
          },
          "retweeted_user": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retweeted User"
          },
          "retweeted_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retweeted Id"
          },
          "retweeted_profile_image_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retweeted Profile Image Url"
          },
          "is_retweet": {
            "type": "boolean",
            "title": "Is Retweet"
          },
          "media": {
            "items": {
              "$ref": "#/components/schemas/TwitterMedia"
            },
            "type": "array",
            "title": "Media",
            "description": "Post media objects, in source order."
          },
          "sentiment": {
            "type": "string",
            "title": "Sentiment"
          },
          "gender": {
            "type": "string",
            "title": "Gender"
          },
          "url": {
            "type": "string",
            "title": "Url"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "source_key",
          "id",
          "created_at",
          "updated_at",
          "text",
          "source",
          "author",
          "public_metrics",
          "hashtags",
          "mentions",
          "retweeted_user",
          "retweeted_id",
          "retweeted_profile_image_url",
          "is_retweet",
          "media",
          "sentiment",
          "gender",
          "url"
        ],
        "title": "TwitterMention"
      },
      "TwitterPublicMetrics": {
        "properties": {
          "retweet_count": {
            "type": "integer",
            "title": "Retweet Count"
          },
          "reply_count": {
            "type": "integer",
            "title": "Reply Count"
          },
          "like_count": {
            "type": "integer",
            "title": "Like Count"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "retweet_count",
          "reply_count",
          "like_count"
        ],
        "title": "TwitterPublicMetrics"
      },
      "UpdateKeyword": {
        "properties": {
          "keyword": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Keyword"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "keyword"
        ],
        "title": "UpdateKeyword"
      },
      "YouTubeChannel": {
        "properties": {
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "thumbnail_url": {
            "type": "string",
            "title": "Thumbnail Url"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "title",
          "thumbnail_url"
        ],
        "title": "YouTubeChannel"
      },
      "YouTubeMention": {
        "properties": {
          "source_key": {
            "type": "string",
            "const": "youtube",
            "title": "Source Key"
          },
          "id": {
            "type": "string",
            "title": "Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "published_at": {
            "type": "string",
            "format": "date-time",
            "title": "Published At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "embed_url": {
            "type": "string",
            "title": "Embed Url"
          },
          "thumbnail_url": {
            "type": "string",
            "title": "Thumbnail Url"
          },
          "channel": {
            "$ref": "#/components/schemas/YouTubeChannel"
          },
          "public_metrics": {
            "$ref": "#/components/schemas/YouTubePublicMetrics"
          },
          "duration_seconds": {
            "type": "integer",
            "title": "Duration Seconds",
            "description": "Stored video duration in seconds."
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tags"
          },
          "categories": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Categories"
          },
          "sentiment": {
            "type": "string",
            "title": "Sentiment"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "source_key",
          "id",
          "title",
          "description",
          "published_at",
          "updated_at",
          "url",
          "embed_url",
          "thumbnail_url",
          "channel",
          "public_metrics",
          "duration_seconds",
          "tags",
          "categories",
          "sentiment"
        ],
        "title": "YouTubeMention"
      },
      "YouTubePublicMetrics": {
        "properties": {
          "view_count": {
            "type": "integer",
            "title": "View Count"
          },
          "like_count": {
            "type": "integer",
            "title": "Like Count"
          },
          "comment_count": {
            "type": "integer",
            "title": "Comment Count"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "view_count",
          "like_count",
          "comment_count"
        ],
        "title": "YouTubePublicMetrics"
      },
      "ErrorEnvelope": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "fields": {
                "type": "array",
                "description": "Present on validation_error.",
                "items": {
                  "type": "object",
                  "required": [
                    "field",
                    "message"
                  ],
                  "properties": {
                    "field": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "DataResponseNews": {
        "properties": {
          "keyword": {
            "$ref": "#/components/schemas/DataKeyword"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NewsMention"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        },
        "type": "object",
        "required": [
          "keyword",
          "data",
          "pagination"
        ],
        "title": "DataResponseNews"
      },
      "DataResponseTwitter": {
        "properties": {
          "keyword": {
            "$ref": "#/components/schemas/DataKeyword"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TwitterMention"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        },
        "type": "object",
        "required": [
          "keyword",
          "data",
          "pagination"
        ],
        "title": "DataResponseTwitter"
      },
      "DataResponseInstagram": {
        "properties": {
          "keyword": {
            "$ref": "#/components/schemas/DataKeyword"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InstagramMention"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        },
        "type": "object",
        "required": [
          "keyword",
          "data",
          "pagination"
        ],
        "title": "DataResponseInstagram"
      },
      "DataResponseThreads": {
        "properties": {
          "keyword": {
            "$ref": "#/components/schemas/DataKeyword"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ThreadsMention"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        },
        "type": "object",
        "required": [
          "keyword",
          "data",
          "pagination"
        ],
        "title": "DataResponseThreads"
      },
      "DataResponseYoutube": {
        "properties": {
          "keyword": {
            "$ref": "#/components/schemas/DataKeyword"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YouTubeMention"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        },
        "type": "object",
        "required": [
          "keyword",
          "data",
          "pagination"
        ],
        "title": "DataResponseYoutube"
      },
      "DataResponseTiktok": {
        "properties": {
          "keyword": {
            "$ref": "#/components/schemas/DataKeyword"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TikTokMention"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        },
        "type": "object",
        "required": [
          "keyword",
          "data",
          "pagination"
        ],
        "title": "DataResponseTiktok"
      },
      "DataResponseFacebook": {
        "properties": {
          "keyword": {
            "$ref": "#/components/schemas/DataKeyword"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FacebookMention"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        },
        "type": "object",
        "required": [
          "keyword",
          "data",
          "pagination"
        ],
        "title": "DataResponseFacebook"
      }
    },
    "securitySchemes": {
      "APIKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  },
  "servers": [
    {
      "url": "/",
      "description": "Same origin: /v1 routes to the Echora API"
    }
  ],
  "security": [
    {
      "APIKeyHeader": []
    }
  ],
  "tags": [
    {
      "name": "Account",
      "description": "Your subscription and current per-source quotas."
    },
    {
      "name": "Keywords",
      "description": "Create, list, edit or delete keywords scoped to your account."
    },
    {
      "name": "Online News",
      "description": "Online News data for an active news keyword on your account."
    },
    {
      "name": "X / Twitter",
      "description": "X / Twitter data for an active twitter keyword on your account."
    },
    {
      "name": "Instagram",
      "description": "Instagram data for an active instagram keyword on your account."
    },
    {
      "name": "Threads",
      "description": "Threads data for an active threads keyword on your account."
    },
    {
      "name": "YouTube",
      "description": "YouTube data for an active youtube keyword on your account."
    },
    {
      "name": "TikTok",
      "description": "TikTok data for an active tiktok keyword on your account."
    },
    {
      "name": "Facebook",
      "description": "Facebook data for an active facebook keyword on your account."
    }
  ]
}
