From 590feec549a82496fa0fe48d36091b36a57aead5 Mon Sep 17 00:00:00 2001 From: vigneshakaviki Date: Fri, 10 Apr 2026 20:26:35 -0700 Subject: [PATCH] Add stub endpoints for trends and suggestions Mastodon clients (including the official iOS app) expect the trends and suggestions endpoints to return empty arrays rather than 404. Without these stubs, the iOS app throws "The data couldn't be read" errors when navigating to Search or certain timelines. Added endpoints: - GET /api/v1/trends (alias for /trends/tags) - GET /api/v1/trends/tags - GET /api/v1/trends/statuses - GET /api/v1/trends/links - GET /api/v1/suggestions - GET /api/v2/suggestions All return empty JSON arrays for now, matching the behavior of Mastodon instances that have no trending data or suggestions. Ref #421 --- src/api/v1/index.ts | 22 ++++++++++++++++++++++ src/api/v2/index.ts | 4 ++++ 2 files changed, 26 insertions(+) diff --git a/src/api/v1/index.ts b/src/api/v1/index.ts index 84addbf0..31d8e902 100644 --- a/src/api/v1/index.ts +++ b/src/api/v1/index.ts @@ -85,6 +85,28 @@ app.get("/announcements", (c) => { return c.json([]); }); +app.get("/trends/tags", (c) => { + return c.json([]); +}); + +app.get("/trends/statuses", (c) => { + return c.json([]); +}); + +app.get("/trends/links", (c) => { + return c.json([]); +}); + +// Mastodon clients also request /trends without a subpath, +// which is equivalent to /trends/tags: +app.get("/trends", (c) => { + return c.json([]); +}); + +app.get("/suggestions", (c) => { + return c.json([]); +}); + app.get( "/favourites", tokenRequired, diff --git a/src/api/v2/index.ts b/src/api/v2/index.ts index e50089bc..6d135936 100644 --- a/src/api/v2/index.ts +++ b/src/api/v2/index.ts @@ -46,6 +46,10 @@ app.route("/notifications", notificationsRoutes); app.post("/media", tokenRequired, scopeRequired(["write:media"]), postMedia); +app.get("/suggestions", (c) => { + return c.json([]); +}); + app.get( "/search", tokenRequired,