{"id":20290205,"url":"https://github.com/lvidarte/generic-api","last_synced_at":"2026-05-02T08:32:30.743Z","repository":{"id":137106047,"uuid":"94254487","full_name":"lvidarte/generic-api","owner":"lvidarte","description":"Quick schemaless and generic API for development tests","archived":false,"fork":false,"pushed_at":"2017-11-22T15:33:19.000Z","size":21,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-04T04:42:24.549Z","etag":null,"topics":["alpine","api","docker","flask","python"],"latest_commit_sha":null,"homepage":"","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/lvidarte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-06-13T20:24:31.000Z","updated_at":"2018-10-31T05:44:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"cdbf078b-de2d-4b34-969e-7cf0b3b5f2df","html_url":"https://github.com/lvidarte/generic-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lvidarte/generic-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvidarte%2Fgeneric-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvidarte%2Fgeneric-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvidarte%2Fgeneric-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvidarte%2Fgeneric-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lvidarte","download_url":"https://codeload.github.com/lvidarte/generic-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvidarte%2Fgeneric-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32528223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["alpine","api","docker","flask","python"],"created_at":"2024-11-14T15:06:36.534Z","updated_at":"2026-05-02T08:32:30.720Z","avatar_url":"https://github.com/lvidarte.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Generic API\n\nThis is a shemaless and generic api for development tests. You can create any endpoint and add json objects as you wish. The data is persisted on disk by [shelve](https://docs.python.org/3.5/library/shelve.html).\n\n\n### Run with docker (Alpine Linux based)\n\n    docker run -d --name generic-api -v `pwd`/data:/app/data -p 5000:5000 lvidarte/generic-api:latest\n\n\n### POST method\n\nThe header `Content-Type: application/json` is not necessary, the api assumes you are sending jsons.\n\n    $ curl localhost:5000/points -d '{\"x\": 1, \"y\": 2}'\n    {\n      \"_id\": \"1\", \n      \"x\": 1, \n      \"y\": 2\n    }\n\n\u003c!-- --\u003e\n\n    $ curl localhost:5000/points -d '{\"x\": 5, \"y\": 10}'\n    {\n      \"_id\": \"2\", \n      \"x\": 5, \n      \"y\": 10\n    }\n\n\n### GET method\n\n    $ curl localhost:5000/points\n    {\n      \"1\": {\n        \"_id\": \"1\", \n        \"x\": 1, \n        \"y\": 2\n      }, \n      \"2\": {\n        \"_id\": \"2\", \n        \"x\": 5, \n        \"y\": 10\n      }\n    }\n\n\u003c!-- --\u003e\n\n    $ curl localhost:5000/points/1\n    {\n      \"_id\": \"1\", \n      \"x\": 1, \n      \"y\": 2\n    }\n\n\u003c!-- --\u003e\n\n    $ curl localhost:5000/points/1/x\n    1\n\n\n### DELETE method\n\n    $ curl -XDELETE localhost:5000/points/1\n    {\n      \"_id\": \"1\", \n      \"x\": 1, \n      \"y\": 2\n    }\n\n### Nested example\n\nCreate authors and books\n\n    $ curl localhost:5000/authors -d '{\"name\": \"Asimov\"}'\n    {\n      \"_id\": \"1\", \n      \"name\": \"Asimov\"\n    }\n\n    $ curl localhost:5000/authors/1/books -d '{\"title\": \"Nemesis\", \"year\": 1988}'\n    {\n      \"_id\": \"1\", \n      \"title\": \"Nemesis\", \n      \"year\": 1988\n    }\n\n    $ curl localhost:5000/authors/1/books -d '{\"title\": \"Foundation and Earth\", \"year\": 1987}'\n    {\n      \"_id\": \"2\", \n      \"title\": \"Foundation and Earth\", \n      \"year\": 1987\n    }\n\nGet the full data\n\n    $ curl localhost:5000/authors/1\n    {\n      \"_id\": \"1\", \n      \"books\": {\n        \"1\": {\n          \"_id\": \"1\", \n          \"title\": \"Nemesis\", \n          \"year\": 1988\n        }, \n        \"2\": {\n          \"_id\": \"2\", \n          \"title\": \"Foundation and Earth\", \n          \"year\": 1987\n        }\n      }, \n      \"name\": \"Asimov\"\n    }\n\nYou can get only some field\n\n    $ curl localhost:5000/authors/1/books/2/title\n    \"Foundation and Earth\"\n\n    $ curl localhost:5000/authors/1/books/2/year\n    1987\n\nAnd change any field as you wish\n\n    $ curl localhost:5000/authors/1/books/2/year -d '1986'\n    1986\n\n\n    $ curl localhost:5000/authors/1/books/2\n    {\n      \"_id\": \"2\", \n      \"title\": \"Foundation and Earth\", \n      \"year\": 1986\n    }\n\n### PUT method\n\nThere is not PUT method, use POST instead.\n\n### Logs\n\n    $ docker logs -f generic-api \n    172.17.0.1 - - [16/Jun/2017 04:50:56] \"GET /points HTTP/1.1\" 200 -\n    172.17.0.1 - - [16/Jun/2017 04:51:40] \"POST /points HTTP/1.1\" 201 -\n    172.17.0.1 - - [16/Jun/2017 04:51:55] \"DELETE /points/1 HTTP/1.1\" 404 -\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flvidarte%2Fgeneric-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flvidarte%2Fgeneric-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flvidarte%2Fgeneric-api/lists"}