Skip to content

Every analytics tool wants a subscription. And your data. I built Twiligent instead. YouTube stats. Instagram stats. One dashboard. Runs locally on your machine.

9.9 KB
Raw Blame
{
    "result": {
        "responses": [
            {
                "call": "GET /tracked-content",
                "status": 200,
                "body": "[{\"id\":\"t-youtube\",\"url\":\"https://www.youtube.com/watch?v=abc\",\"label\":\"\",\"category\":\"\",\"contentType\":\"youtube\",\"createdAt\":\"2026-08-01T00:00:00Z\",\"updatedAt\":\"2026-08-01T00:00:00Z\",\"title\":\"Video\"},{\"id\":\"t-short\",\"url\":\"https://www.youtube.com/shorts/def\",\"label\":\"\",\"category\":\"\",\"contentType\":\"youtube\",\"createdAt\":\"2026-08-01T00:00:00Z\",\"updatedAt\":\"2026-08-01T00:00:00Z\",\"title\":\"Short\",\"viewCount\":9}]"
            },
            {
                "call": "POST /tracked-content/t-retired/refresh",
                "status": 404,
                "body": "{\"success\":false,\"code\":\"NOT_FOUND\",\"message\":\"Tracked content not found\",\"requestId\":\"req-test\"}"
            },
            {
                "call": "POST /tracked-content/t-youtube/refresh",
                "status": 200,
                "body": "{\"id\":\"t-youtube\",\"url\":\"https://www.youtube.com/watch?v=abc\",\"label\":\"\",\"category\":\"\",\"contentType\":\"youtube\",\"createdAt\":\"2026-08-01T00:00:00Z\",\"updatedAt\":\"2026-09-01T12:00:00.000Z\",\"title\":\"Watch\",\"channelTitle\":\"Ribbon\",\"channelId\":\"UC1\",\"thumbnail\":\"m\",\"publishedAt\":\"2026-08-01T10:00:00Z\",\"viewCount\":1500,\"likeCount\":40,\"commentCount\":3,\"isShort\":false,\"permalink\":\"https://www.youtube.com/watch?v=abc\",\"lastFetchedAt\":\"2026-09-01T12:00:00.000Z\"}"
            },
            {
                "call": "POST /tracked-content/nope/refresh",
                "status": 404,
                "body": "{\"success\":false,\"code\":\"NOT_FOUND\",\"message\":\"Tracked content not found\",\"requestId\":\"req-test\"}"
            },
            {
                "call": "DELETE /tracked-content/t-youtube",
                "status": 200,
                "body": "{\"success\":true}"
            },
            {
                "call": "DELETE /tracked-content/t-youtube",
                "status": 404,
                "body": "{\"success\":false,\"code\":\"NOT_FOUND\",\"message\":\"Tracked content not found\",\"requestId\":\"req-test\"}"
            },
            {
                "call": "DELETE /tracked-content/t-retired",
                "status": 404,
                "body": "{\"success\":false,\"code\":\"NOT_FOUND\",\"message\":\"Tracked content not found\",\"requestId\":\"req-test\"}"
            }
        ],
        "queries": [
            {
                "type": "select",
                "table": "tracked_posts",
                "columns": "id, url, label, category, content_type, created_at, updated_at, data",
                "filters": [
                    [
                        "user_id",
                        "user-1"
                    ],
                    [
                        "content_type",
                        "youtube"
                    ]
                ]
            },
            {
                "type": "select",
                "table": "tracked_posts",
                "columns": "id, url, label, category, content_type, created_at, updated_at, data",
                "filters": [
                    [
                        "id",
                        "t-retired"
                    ],
                    [
                        "user_id",
                        "user-1"
                    ],
                    [
                        "content_type",
                        "youtube"
                    ]
                ]
            },
            {
                "type": "select",
                "table": "tracked_posts",
                "columns": "id, url, label, category, content_type, created_at, updated_at, data",
                "filters": [
                    [
                        "id",
                        "t-youtube"
                    ],
                    [
                        "user_id",
                        "user-1"
                    ],
                    [
                        "content_type",
                        "youtube"
                    ]
                ]
            },
            {
                "type": "rpc",
                "table": "merge_tracked_post_data",
                "values": {
                    "p_id": "t-youtube",
                    "p_user_id": "user-1",
                    "p_patch": {
                        "contentType": "youtube",
                        "title": "Watch",
                        "channelTitle": "Ribbon",
                        "channelId": "UC1",
                        "thumbnail": "m",
                        "publishedAt": "2026-08-01T10:00:00Z",
                        "viewCount": 1500,
                        "likeCount": 40,
                        "commentCount": 3,
                        "isShort": false,
                        "permalink": "https://www.youtube.com/watch?v=abc",
                        "lastFetchedAt": "2026-09-01T12:00:00.000Z"
                    }
                },
                "filters": []
            },
            {
                "type": "select",
                "table": "tracked_posts",
                "columns": "id, url, label, category, content_type, created_at, updated_at, data",
                "filters": [
                    [
                        "id",
                        "t-youtube"
                    ],
                    [
                        "user_id",
                        "user-1"
                    ],
                    [
                        "content_type",
                        "youtube"
                    ]
                ]
            },
            {
                "type": "select",
                "table": "tracked_posts",
                "columns": "id, url, label, category, content_type, created_at, updated_at, data",
                "filters": [
                    [
                        "id",
                        "nope"
                    ],
                    [
                        "user_id",
                        "user-1"
                    ],
                    [
                        "content_type",
                        "youtube"
                    ]
                ]
            },
            {
                "type": "select",
                "table": "tracked_posts",
                "columns": "id, url, label, category, content_type, created_at, updated_at, data",
                "filters": [
                    [
                        "id",
                        "t-youtube"
                    ],
                    [
                        "user_id",
                        "user-1"
                    ],
                    [
                        "content_type",
                        "youtube"
                    ]
                ]
            },
            {
                "type": "delete",
                "table": "tracked_posts",
                "filters": [
                    [
                        "id",
                        "t-youtube"
                    ],
                    [
                        "user_id",
                        "user-1"
                    ]
                ]
            },
            {
                "type": "select",
                "table": "tracked_posts",
                "columns": "id, url, label, category, content_type, created_at, updated_at, data",
                "filters": [
                    [
                        "id",
                        "t-youtube"
                    ],
                    [
                        "user_id",
                        "user-1"
                    ],
                    [
                        "content_type",
                        "youtube"
                    ]
                ]
            },
            {
                "type": "select",
                "table": "tracked_posts",
                "columns": "id, url, label, category, content_type, created_at, updated_at, data",
                "filters": [
                    [
                        "id",
                        "t-retired"
                    ],
                    [
                        "user_id",
                        "user-1"
                    ],
                    [
                        "content_type",
                        "youtube"
                    ]
                ]
            }
        ],
        "requests": [
            {
                "url": "https://www.googleapis.com/youtube/v3/videos?part=snippet%2Cstatistics&id=abc&key=YTKEY",
                "method": "GET"
            }
        ],
        "logLines": []
    },
    "withoutKey": {
        "responses": [
            {
                "call": "POST /tracked-content/t-youtube/refresh",
                "status": 503,
                "body": "{\"success\":false,\"code\":\"NOT_CONFIGURED\",\"message\":\"YouTube API key not configured on this server\",\"requestId\":\"req-test\"}"
            }
        ],
        "queries": [
            {
                "type": "select",
                "table": "tracked_posts",
                "columns": "id, url, label, category, content_type, created_at, updated_at, data",
                "filters": [
                    [
                        "id",
                        "t-youtube"
                    ],
                    [
                        "user_id",
                        "user-1"
                    ],
                    [
                        "content_type",
                        "youtube"
                    ]
                ]
            }
        ],
        "requests": [],
        "logLines": [
            [
                "error",
                "{\"level\":\"error\",\"message\":\"request failed\",\"requestId\":\"req-test\",\"userId\":\"user-1\",\"code\":\"NOT_CONFIGURED\",\"status\":503,\"error\":\"YouTube API key not configured on this server\",\"errorName\":\"NotConfiguredError\"}"
            ]
        ]
    }
}