{"id":32045190,"url":"https://github.com/1adityakadam/build-a-rest-api-in-python","last_synced_at":"2026-07-15T20:01:55.236Z","repository":{"id":316828289,"uuid":"1065012275","full_name":"1adityakadam/Build-a-REST-API-in-Python","owner":"1adityakadam","description":"This project showcases creating a RESTful API using Flask and SQLAlchemy. It demonstrates CRUD operations, database integration with SQLite, and endpoint testing via Postman, providing a hands-on introduction to API development and backend fundamentals.","archived":false,"fork":false,"pushed_at":"2025-09-26T23:20:33.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-29T22:40:52.587Z","etag":null,"topics":["crud-operation","flask","rest-api","sqlalchemy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1adityakadam.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-26T23:08:55.000Z","updated_at":"2025-09-29T15:03:10.000Z","dependencies_parsed_at":"2025-09-28T14:34:12.034Z","dependency_job_id":null,"html_url":"https://github.com/1adityakadam/Build-a-REST-API-in-Python","commit_stats":null,"previous_names":["1adityakadam/build-a-rest-api-in-python"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/1adityakadam/Build-a-REST-API-in-Python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1adityakadam%2FBuild-a-REST-API-in-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1adityakadam%2FBuild-a-REST-API-in-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1adityakadam%2FBuild-a-REST-API-in-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1adityakadam%2FBuild-a-REST-API-in-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1adityakadam","download_url":"https://codeload.github.com/1adityakadam/Build-a-REST-API-in-Python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1adityakadam%2FBuild-a-REST-API-in-Python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35519051,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-15T02:00:06.706Z","response_time":131,"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":["crud-operation","flask","rest-api","sqlalchemy"],"created_at":"2025-10-17T20:05:14.173Z","updated_at":"2026-07-15T20:01:55.229Z","avatar_url":"https://github.com/1adityakadam.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Build a REST API in Python\n\nThis project demonstrates how to build a fully functional REST API in Python using Flask and SQLAlchemy. It covers everything from the basics of APIs to integrating a database and testing endpoints with Postman.\n\n\u003cimg width=\"2848\" height=\"1648\" alt=\"image\" src=\"https://github.com/user-attachments/assets/ef7cf3cf-84c6-47f8-baa5-490d8170b7ed\" /\u003e \u003cbr\u003e\n\n## What is an API?\n\nAn API (Application Programming Interface) allows communication between a client (front-end) and a server (back-end).\nThis project implements a REST API (Representational State Transfer), which organizes resources into unique URIs and supports standard `CRUD operations`:\n\n- POST → Create data\n\n- GET → Read data\n\n- PUT → Update data\n\n- DELETE → Delete data\n\nAll interactions are handled with JSON payloads for cross-language compatibility.\n\n## Tech Stack\n\n- Python 3\n\n- Flask → Lightweight framework for API routes\n\n- Flask-SQLAlchemy → ORM to manage database models\n\n- SQLite → Database backend\n\n- Postman → API testing\n\n## Setup Instructions\n\n ## Clone the repo\n\n- git clone https://github.com/your-username/build-rest-api-python.git\n- cd build-rest-api-python\n\n\n## Create a virtual environment\n\n- python3 -m venv api_env\n- source api_env/bin/activate\n\n\n## Install dependencies\n\npip install -r requirements.txt\n\n\n## Run the app\n\npython app.py\n\n\nYour API will be live at:\n\nhttp://127.0.0.1:5000\n\n\u003cimg width=\"445\" height=\"144\" alt=\"image\" src=\"https://github.com/user-attachments/assets/d7b23109-63c3-49f7-8279-c020adcee070\" /\u003e\n\n## Database Model\n\nThe project uses a simple Destinations table:\n\n- Field\tType\tDescription\n- id\tInteger\tPrimary key\n- destination\tString\tCity or location name\n- country\tString\tAssociated country\n- rating\tFloat\tRating score (1.0 - 5.0)\n\n## API Endpoints\nMethod\tEndpoint\tDescription\n- GET\t/\tWelcome message\n- GET\t/destinations\tFetch all destinations\n- GET\t/destinations/\u003cid\u003e\tFetch destination by ID\n- POST\t/destinations\tAdd a new destination\n- PUT\t/destinations/\u003cid\u003e\tUpdate destination by ID\n- DELETE\t/destinations/\u003cid\u003e\tDelete destination by ID\n\n## Testing with Postman\n\nOpen Postman and enter the API base URL:\n\nhttp://127.0.0.1:5000\n\n\n##Test requests:\n\n- GET /destinations → Returns all data in JSON.\n\n- POST /destinations with body:\n\n    `{\n      \"destination\": \"Paris\",\n      \"country\": \"France\",\n      \"rating\": 4.8\n    }`\n\n\n- PUT /destinations/1 → Update entry with ID 1.\n\n- DELETE /destinations/1 → Remove entry with ID 1.\n\n---\n\n`### Learnt from ~ Code with Josh @ YT`\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1adityakadam%2Fbuild-a-rest-api-in-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1adityakadam%2Fbuild-a-rest-api-in-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1adityakadam%2Fbuild-a-rest-api-in-python/lists"}