Something went wrong. Try again.
grab primary colors from a bsky pfp
Something went wrong. Try again.
bsky-primary openapi.json
7.3 kB · 273 lines
JSON
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274{ "openapi": "3.1.0", "info": { "title": "bsky-primary", "description": "Extract two prominent colors — a luminance-sorted `light` and `dark` pair — from a Bluesky user's avatar. Useful for theming UI to match someone's profile picture.\n\nAvatars are resolved through the public Bluesky API (no auth), resampled, and reduced to two dominant colors. Results are cached in-memory for 24h; a value is `null` when the avatar can't be fetched, decoded, or yields no usable color.", "version": "1.0.0" }, "servers": [ { "url": "https://bsky-primary.cee.wtf", "description": "Production" } ], "paths": { "/healthz": { "get": { "tags": [ "meta" ], "summary": "Healthz", "description": "Liveness probe and cache size.", "operationId": "healthz_healthz_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Health" } } } } } } }, "/colors/{actor}": { "get": { "tags": [ "colors" ], "summary": "Colors One", "description": "Colors for a single Bluesky actor (handle or DID).\n\nReturns `null` if the actor can't be resolved or yields no usable color.", "operationId": "colors_one_colors__actor__get", "parameters": [ { "name": "actor", "in": "path", "required": true, "schema": { "type": "string", "title": "Actor" } }, { "name": "refresh", "in": "query", "required": false, "schema": { "type": "boolean", "description": "Bypass the cache and re-fetch the avatar.", "default": false, "title": "Refresh" }, "description": "Bypass the cache and re-fetch the avatar." } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/Colors" }, { "type": "null" } ], "title": "Response Colors One Colors Actor Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/colors": { "post": { "tags": [ "colors" ], "summary": "Colors", "description": "Colors for a batch of actors.\n\nThe response is keyed by the exact strings you sent, so callers can match\nresults directly against their input.", "operationId": "colors_colors_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ColorsRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": { "anyOf": [ { "$ref": "#/components/schemas/Colors" }, { "type": "null" } ] }, "type": "object", "title": "Response Colors Colors Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } } }, "components": { "schemas": { "Colors": { "properties": { "light": { "type": "string", "title": "Light", "description": "Higher-luminance color (fills/backgrounds), as #rrggbb.", "examples": [ "#e2c48f" ] }, "dark": { "type": "string", "title": "Dark", "description": "Lower-luminance color (strokes/text), as #rrggbb.", "examples": [ "#5a3b21" ] } }, "type": "object", "required": [ "light", "dark" ], "title": "Colors" }, "ColorsRequest": { "properties": { "actors": { "items": { "type": "string" }, "type": "array", "maxItems": 60, "title": "Actors", "description": "Bluesky handles or DIDs. A leading @ is optional.", "examples": [ [ "@bsky.app", "did:plc:z72i7hdynmk6r22z27h6tvur" ] ] } }, "type": "object", "required": [ "actors" ], "title": "ColorsRequest" }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "Health": { "properties": { "ok": { "type": "boolean", "title": "Ok" }, "cache_size": { "type": "integer", "title": "Cache Size", "description": "Number of cached actor entries." } }, "type": "object", "required": [ "ok", "cache_size" ], "title": "Health" }, "ValidationError": { "properties": { "loc": { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] }, "type": "array", "title": "Location" }, "msg": { "type": "string", "title": "Message" }, "type": { "type": "string", "title": "Error Type" } }, "type": "object", "required": [ "loc", "msg", "type" ], "title": "ValidationError" } } }}