{"id":24551701,"url":"https://github.com/regulad/shitpostapi","last_synced_at":"2025-10-04T02:30:56.208Z","repository":{"id":37942111,"uuid":"374237401","full_name":"regulad/ShitpostAPI","owner":"regulad","description":"An API for making quick edits of media, normally memes, to create a new type of media commonly referred to as a shitpost.","archived":false,"fork":false,"pushed_at":"2023-02-13T22:57:37.000Z","size":79,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-23T13:56:44.374Z","etag":null,"topics":["api","web","webserver"],"latest_commit_sha":null,"homepage":"https://shitposts.dingus-server.regulad.xyz/v1/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/regulad.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}},"created_at":"2021-06-06T00:30:04.000Z","updated_at":"2024-04-23T13:56:44.375Z","dependencies_parsed_at":"2023-01-28T02:01:20.444Z","dependency_job_id":null,"html_url":"https://github.com/regulad/ShitpostAPI","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/regulad%2FShitpostAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regulad%2FShitpostAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regulad%2FShitpostAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regulad%2FShitpostAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/regulad","download_url":"https://codeload.github.com/regulad/ShitpostAPI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235209067,"owners_count":18953008,"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":["api","web","webserver"],"created_at":"2025-01-23T01:17:56.876Z","updated_at":"2025-10-04T02:30:50.812Z","avatar_url":"https://github.com/regulad.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ShitpostAPI\n\nAn API for making quick edits of media, normally memes, to create a new type of media commonly referred to as a shitpost.\n\n## Hosting\n\nDocker is the preferred way to host an instance of the API.\n\nEnvironment Variables:\n\n* `SHITPOST_API_PORT`: Configures the webserver port. Default is `8081`.\n* `SHITPOST_API_HOST`: Configures the webserver host. Default is `0.0.0.0`.\n* `SHITPOST_API_URI`: MongoDB connection URI. Default is `mongodb://mongo`.\n* `SHITPOST_API_DB`: MongoDB database name. Default is `shitposts`.\n* `SHITPOST_API_CACHE`: Relative (or absolute) path of the file cache. Default is `downloads/`\n\n## API\n\n### Limiting\n\nTo protect against abuse and optimize performance, the API enforces some rate-limits.\n\n**Every hour**:\n\n* You may make 90 requests.\n* Each request may be 20 megabytes in size or smaller.\n\nIf you exceed your 90 requests per hour, you will be unable to make any more requests until time expires.\n\nThree headers are sent back in each response:\n\n* `X-RateLimit-Limit`: The maximum amount of requests you can make in one period. By defualt, this is 90.\n* `X-RateLimit-Remaining`: The remaining requests in the current period.\n* `X-RateLimit-Reset`: Time until the end of the period, in seconds.\n\n### Privacy\n\nIP addresses are stored in the `users` collection of the database.\n\nNo other sensitive information is stored with this IP address, besides information critical to operation like basic metrics and rate limit data.\n\n### Endpoints\n\n#### GET `/`\n\nReturn the lines of this file: `README.md`.\n\n#### GET `/user`\n\nReturns all the data on you that is stored in the database. Yay, transparency!\n\n#### POST `/edit`\n\nReturns a stream of bytes from a multipart request to edit a video.\n\nForm fields:\n\n* Media:\n    * Type: Bytes\n    * Content: The media you wish to edit, in bytes. Limited to 20MB, for performance reasons.\n    * Headers:\n        * Content-Type: The MIME type of the media.\n* Edits:\n    * Type: String\n    * Content: A JSON-Encoded string of the commands you wish to execute and their values.\n    * Headers:\n        * Content-Type: application/json\n    \nEdits example:\n\n```json\n{\n  \"edits\": [\n    {\n      \"name\": \"caption\",\n      \"parameters\": {\n        \"top\": \"Some string, eh?\"\n      }\n    }  \n  ]\n}\n```\n\nIf an edit's parameters are incorrect, it will continue to the next edit. If you don't want to pass any arguments, simply pass an empty object.\n\n```json\n{}\n```\n\n#### GET `/commands`\n\nReturns JSON data detailing available commands.\n\nExample return:\n\n```json\n{\n  \"commands\": [\n    {\n      \"name\": \"caption\",\n      \"parameters\": [\n        {\n          \"name\": \"top\",\n          \"type\": null\n        },\n        {\n          \"name\": \"bottom\",\n          \"type\": null\n        }\n      ],\n      \"description\": \"Appends text in impact font the top or bottom of an image.\"\n    }\n  ]\n}\n```\n\nA `null` parameters means that the command does not take arguments.\n\nA `null` type means that either the type cannot be translated into a string, or it takes any type.\n\n\n### GET `/commands/{command_name}`\n\nSame as `commands`, but it looks up a single command.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fregulad%2Fshitpostapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fregulad%2Fshitpostapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fregulad%2Fshitpostapi/lists"}