{"id":23141680,"url":"https://github.com/zekrotja/example-rest-api","last_synced_at":"2026-04-16T19:08:25.229Z","repository":{"id":164409254,"uuid":"639666858","full_name":"zekroTJA/example-rest-api","owner":"zekroTJA","description":"An open demo REST API to build demos on, test stuff against or just play around with.","archived":false,"fork":false,"pushed_at":"2024-05-29T13:52:59.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T17:53:29.784Z","etag":null,"topics":["demo-api","example","example-api","example-rest-api","rest","rest-api","rust","vercel"],"latest_commit_sha":null,"homepage":"https://example-rest-api.vercel.app","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zekroTJA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-12T00:46:07.000Z","updated_at":"2024-05-29T13:53:03.000Z","dependencies_parsed_at":"2024-05-07T14:31:12.268Z","dependency_job_id":"985f5319-1a98-4bba-949d-ee80b87e6944","html_url":"https://github.com/zekroTJA/example-rest-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zekroTJA%2Fexample-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zekroTJA%2Fexample-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zekroTJA%2Fexample-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zekroTJA%2Fexample-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zekroTJA","download_url":"https://codeload.github.com/zekroTJA/example-rest-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247166815,"owners_count":20894797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["demo-api","example","example-api","example-rest-api","rest","rest-api","rust","vercel"],"created_at":"2024-12-17T14:14:10.303Z","updated_at":"2026-04-16T19:08:25.138Z","avatar_url":"https://github.com/zekroTJA.png","language":"Rust","readme":"# Example REST API\n\nAn open source CRUD REST API to build demos on, test stuff against or just play around with.\n\n## Motivation\n\nFor other projects, I was using [restful-api.dev](https://restful-api.dev/) to build demos or tests on. But recently, this page proved to be somewhat inconsistent and unreliable, so I wanted to build something hosted on [Vercel](https://vercel.com) using [Upstash](https://upstash.com/) as Redis Store, so that it should be a pretty reliable alternative.\n\n## API Documentation\n\nThe live API root endpoint is as following.\n```\nhttps://example-rest-api.vercel.app\n```\n\nThe API accepts request payloads as `application/json` and responses are encoded in `application/json`.\n\n\u003e **Warning**  \n\u003e Created objects are **not persistent nor protected**. Objects are usually automatically removed 24 hours after creation or modification. Objects and collection are not proof against modification by unauthorized individuals.\n\n### Objects\n\n#### `Collection`\n\n```ts\ntype CollectionRequest = {\n    name: string;\n};\n\ntype CollectionResponse = {\n    id: string;\n    created_at: string; // Format: RFC3339\n    name: string;\n};\n```\n\n#### `Object`\n\n```ts\ntype ObjectRequest = {\n    name: string;\n    data: { [key: string]: any };\n};\n\ntype ObjectResponse = {\n    id: string;\n    created_at: string; // Format: RFC3339\n    name: string;\n    data: { [key: string]: any };\n};\n```\n\n### Endpoints\n\n#### Create Collection\n\nCreate a new collection.\n\n```\nPOST /api/collections\n```\n\n##### Request Payload\n\n```ts\nCollectionRequest\n```\n\n*Example:*\n```json\n{\n    \"name\": \"my games\"\n}\n```\n\n##### Response Payload\n\n```ts\nCollectionResponse\n```\n\n*Example:*\n```json\n{\n\t\"id\": \"chf13ur2iejc717547r0\",\n\t\"created_at\": \"2023-05-12T10:16:27.319442753+00:00\",\n\t\"name\": \"my games\"\n}\n```\n\n#### Get Collection\n\nRetrieve information about a collection by ID.\n\n```\nGET /api/collections/:collectionid\n```\n\n##### Response Payload\n\n```ts\nCollectionResponse\n```\n\n*Example:*\n```json\n{\n\t\"id\": \"chf13ur2iejc717547r0\",\n\t\"created_at\": \"2023-05-12T10:16:27.319442753+00:00\",\n\t\"name\": \"my games\"\n}\n```\n\n#### Update Collection\n\nUpdate a collection.\n\n```\nPOST /api/collections/:collectionid\n```\n\n##### Request Payload\n\n```ts\nCollectionRequest\n```\n\n*Example:*\n```json\n{\n    \"name\": \"My Games\"\n}\n```\n\n##### Response Payload\n\n```ts\nCollectionResponse\n```\n\n*Example:*\n```json\n{\n\t\"id\": \"chf13ur2iejc717547r0\",\n\t\"created_at\": \"2023-05-12T10:16:27.319442753+00:00\",\n\t\"name\": \"My Games\"\n}\n```\n\n#### Delete Collection\n\nDelete a collection by ID.\n\n```\nDELETE /api/collections/:collectionid\n```\n\n#### Create Object\n\nCreate a new object in a collection.\n\n```\nPOST /api/collections/:collectionid/objects\n```\n\n##### Request Payload\n\n```ts\nObjectRequest\n```\n\n*Example:*\n```json\n{\n    \"name\": \"Cyberpunk 2077\",\n    \"data\": {\n        \"publisher\": \"CD PROJECT RED\",\n        \"developer\": \"CD PROJECT RED\",\n        \"released\": \"2020-12-10T00:00:00Z\",\n        \"tags\": [\"Cyberpunk\", \"Open World\", \"RPG\", \"Sci-fi\"],\n        \"age_rating\": \"18\"\n    }\n}\n```\n\n##### Response Payload\n\n```ts\nObjectResponse\n```\n\n*Example:*\n```json\n{\n\t\"id\": \"chf15eacaqvs715h7ae0\",\n\t\"created_at\": \"2023-05-12T10:19:37.971387217+00:00\",\n\t\"name\": \"Cyberpunk 2077\",\n\t\"data\": {\n\t\t\"tags\": [\n\t\t\t\"Cyberpunk\",\n\t\t\t\"Open World\",\n\t\t\t\"RPG\",\n\t\t\t\"Sci-fi\"\n\t\t],\n\t\t\"age_rating\": \"18\",\n\t\t\"publisher\": \"CD PROJECT RED\",\n\t\t\"developer\": \"CD PROJECT RED\",\n\t\t\"released\": \"2020-12-10T00:00:00Z\"\n\t}\n}\n```\n\n#### Get Object\n\nRetrieve an object from a collection by ID.\n\n```\nGET /api/collections/:collectionid/objects/:objectid\n```\n\n##### Response Payload\n\n```ts\nObjectResponse\n```\n\n*Example:*\n```json\n{\n\t\"id\": \"chf15eacaqvs715h7ae0\",\n\t\"created_at\": \"2023-05-12T10:19:37.971387217+00:00\",\n\t\"name\": \"Cyberpunk 2077\",\n\t\"data\": {\n\t\t\"tags\": [\n\t\t\t\"Cyberpunk\",\n\t\t\t\"Open World\",\n\t\t\t\"RPG\",\n\t\t\t\"Sci-fi\"\n\t\t],\n\t\t\"age_rating\": \"18\",\n\t\t\"publisher\": \"CD PROJECT RED\",\n\t\t\"developer\": \"CD PROJECT RED\",\n\t\t\"released\": \"2020-12-10T00:00:00Z\"\n\t}\n}\n```\n\n#### Update Object\n\nUpdate an object in a collection.\n\n```\nPOST /api/collections/:collectionid/objects/:objectid\n```\n\n##### Request Payload\n\n```ts\nObjectRequest\n```\n\n*Example:*\n```json\n{\n    \"name\": \"Cyberpunk 2077\",\n    \"data\": {\n        \"publisher\": \"CD PROJECT RED\",\n        \"developer\": \"CD PROJECT RED\",\n        \"released\": \"2020-12-10T00:00:00Z\",\n        \"tags\": [\"Cyberpunk\", \"Open World\", \"RPG\", \"Sci-fi\", \"Explicit\"],\n        \"age_rating\": \"18\"\n    }\n}\n```\n\n#### Delete Object\n\nDelete an object in a collection by ID.\n\n```\nDELETE /api/collections/:collectionid/objects/:objectid\n```\n\n---\n\n© 2023 Ringo Hoffmann.  \nCovered by the [MIT License](LICENSE).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzekrotja%2Fexample-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzekrotja%2Fexample-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzekrotja%2Fexample-rest-api/lists"}