feat: generate image metadata and expose public search API
This commit is contained in:
7 files changed
+450
-93
No files matched your search
+8
-1
@@ -7,6 +7,7 @@ Use this skill when an agent needs to read approved memes from The Meme Protocol
|
||||
- OpenAPI: `__API_BASE_URL__/openapi.json`
|
||||
- Skill instructions: `__API_BASE_URL__/meme-api.skill.md`
|
||||
- Public meme list: `GET __API_BASE_URL__/api/memes`
|
||||
- Public tag catalog: `GET __API_BASE_URL__/api/tags`
|
||||
- Public meme metadata: `GET __API_BASE_URL__/api/memes/{id}`
|
||||
- Public meme image: `GET __API_BASE_URL__/media/{id}`
|
||||
- Add meme: `POST __API_BASE_URL__/api/memes`
|
||||
@@ -15,6 +16,12 @@ Use this skill when an agent needs to read approved memes from The Meme Protocol
|
||||
|
||||
Call `GET __API_BASE_URL__/api/memes?page=1&pageSize=12` to list approved memes. `page` starts at `1`; `pageSize` is capped at `48`. The response includes `page`, `pageSize`, `total`, `totalPages`, `memes`, and `rateLimit`.
|
||||
|
||||
Each meme includes `caption` (searchable text, possibly empty for older images) and `tags` (managed topic names).
|
||||
|
||||
Search using `GET __API_BASE_URL__/api/memes?q=angry%20cat&pageSize=12`. Matching ignores case and accents and tolerates prefixes and small typos. Every query word must match a caption or assigned tag. Results are ordered by relevance, then newest first. This is lexical fuzzy search, not semantic search.
|
||||
|
||||
Read `GET __API_BASE_URL__/api/tags` for the available tag catalog, then filter with `GET __API_BASE_URL__/api/memes?tag=cats`. Repeat `tag` to require multiple topics, and combine it with `q`. Queries are limited to 200 characters and 20 tag filters; invalid filters return `400`. Pages beyond the last page are clamped, so use `totalPages` to stop pagination.
|
||||
|
||||
Call `GET __API_BASE_URL__/api/memes/{id}` to retrieve one approved meme by its 64-character lowercase hex SHA-256 ID. Pending, rejected, deleted, or unknown memes return `404`.
|
||||
|
||||
Use each meme's `url` field to fetch the normalized WebP image. Public image URLs are under `__API_BASE_URL__/media/{id}` and may be cached aggressively by clients.
|
||||
@@ -23,7 +30,7 @@ Read endpoints are rate-limited per IP. Respect `RateLimit-Limit`, `RateLimit-Re
|
||||
|
||||
## Add Memes
|
||||
|
||||
Add a meme with `POST __API_BASE_URL__/api/memes` as `multipart/form-data`. The image file field must be named `meme`.
|
||||
Add a meme with `POST __API_BASE_URL__/api/memes` as `multipart/form-data`. The image file field must be named `meme`. Captions and tags are generated by the server. Public clients cannot create tags or edit image metadata.
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
Reference in new issue
Block a user