[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-339":3},{"id":4,"name":5,"fullName":6,"owner":5,"repo":5,"description":7,"homepage":8,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":9,"pushedAt":9,"updatedAt":44,"readmeContent":45,"aiSummary":46,"trendingCount":15,"starSnapshotCount":15,"syncStatus":47,"lastSyncTime":48,"discoverSource":49},339,"fastapi","fastapi\u002Ffastapi","FastAPI framework, high performance, easy to learn, fast to code, ready for production","https:\u002F\u002Ffastapi.tiangolo.com\u002F",null,"Python",99187,9434,748,1,0,21,186,991,122,120,"MIT License",false,"master",[25,26,27,5,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"api","async","asyncio","framework","json","json-schema","openapi","openapi3","pydantic","python","python-types","python3","redoc","rest","starlette","swagger","swagger-ui","uvicorn","web","2026-06-15 04:00:02","\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Ffastapi.tiangolo.com\">\u003Cimg src=\"https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Flogo-margin\u002Flogo-teal.png\" alt=\"FastAPI\">\u003C\u002Fa>\n\u003C\u002Fp>\n\u003Cp align=\"center\">\n    \u003Cem>FastAPI framework, high performance, easy to learn, fast to code, ready for production\u003C\u002Fem>\n\u003C\u002Fp>\n\u003Cp align=\"center\">\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Ffastapi\u002Ffastapi\u002Factions?query=workflow%3ATest+event%3Apush+branch%3Amaster\">\n    \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Ffastapi\u002Ffastapi\u002Factions\u002Fworkflows\u002Ftest.yml\u002Fbadge.svg?event=push&branch=master\" alt=\"Test\">\n\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fcoverage-badge.samuelcolvin.workers.dev\u002Fredirect\u002Ffastapi\u002Ffastapi\">\n    \u003Cimg src=\"https:\u002F\u002Fcoverage-badge.samuelcolvin.workers.dev\u002Ffastapi\u002Ffastapi.svg\" alt=\"Coverage\">\n\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Ffastapi\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Ffastapi?color=%2334D058&label=pypi%20package\" alt=\"Package version\">\n\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Ffastapi\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fpyversions\u002Ffastapi.svg?color=%2334D058\" alt=\"Supported Python versions\">\n\u003C\u002Fa>\n\u003C\u002Fp>\n\n---\n\n**Documentation**: [https:\u002F\u002Ffastapi.tiangolo.com](https:\u002F\u002Ffastapi.tiangolo.com)\n\n**Source Code**: [https:\u002F\u002Fgithub.com\u002Ffastapi\u002Ffastapi](https:\u002F\u002Fgithub.com\u002Ffastapi\u002Ffastapi)\n\n---\n\nFastAPI is a modern, fast (high-performance), web framework for building APIs with Python based on standard Python type hints.\n\nThe key features are:\n\n* **Fast**: Very high performance, on par with **NodeJS** and **Go** (thanks to Starlette and Pydantic). [One of the fastest Python frameworks available](#performance).\n* **Fast to code**: Increase the speed to develop features by about 200% to 300%. *\n* **Fewer bugs**: Reduce about 40% of human (developer) induced errors. *\n* **Intuitive**: Great editor support. \u003Cdfn title=\"also known as auto-complete, autocompletion, IntelliSense\">Completion\u003C\u002Fdfn> everywhere. Less time debugging.\n* **Easy**: Designed to be easy to use and learn. Less time reading docs.\n* **Short**: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs.\n* **Robust**: Get production-ready code. With automatic interactive documentation.\n* **Standards-based**: Based on (and fully compatible with) the open standards for APIs: [OpenAPI](https:\u002F\u002Fgithub.com\u002FOAI\u002FOpenAPI-Specification) (previously known as Swagger) and [JSON Schema](https:\u002F\u002Fjson-schema.org\u002F).\n\n\u003Csmall>* estimation based on tests conducted by an internal development team, building production applications.\u003C\u002Fsmall>\n\n## Sponsors\n\n\u003C!-- sponsors -->\n### Keystone Sponsor\n\n\u003Ca href=\"https:\u002F\u002Ffastapicloud.com\" target=\"_blank\" title=\"FastAPI Cloud. By the same team behind FastAPI. You code. We Cloud.\">\u003Cimg src=\"https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Fsponsors\u002Ffastapicloud.png\">\u003C\u002Fa>\n\n### Gold Sponsors\n\n\u003Ca href=\"https:\u002F\u002Fblockbee.io?ref=fastapi\" target=\"_blank\" title=\"BlockBee Cryptocurrency Payment Gateway\">\u003Cimg src=\"https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Fsponsors\u002Fblockbee.png\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fscalar\u002Fscalar\u002F?utm_source=fastapi&utm_medium=website&utm_campaign=main-badge\" target=\"_blank\" title=\"Scalar: Beautiful Open-Source API References from Swagger\u002FOpenAPI files\">\u003Cimg src=\"https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Fsponsors\u002Fscalar.svg\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fwww.propelauth.com\u002F?utm_source=fastapi&utm_campaign=1223&utm_medium=mainbadge\" target=\"_blank\" title=\"Auth, user management and more for your B2B product\">\u003Cimg src=\"https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Fsponsors\u002Fpropelauth.png\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fliblab.com?utm_source=fastapi\" target=\"_blank\" title=\"liblab - Generate SDKs from FastAPI\">\u003Cimg src=\"https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Fsponsors\u002Fliblab.png\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fdocs.render.com\u002Fdeploy-fastapi?utm_source=deploydoc&utm_medium=referral&utm_campaign=fastapi\" target=\"_blank\" title=\"Deploy & scale any full-stack web app on Render. Focus on building apps, not infra.\">\u003Cimg src=\"https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Fsponsors\u002Frender.svg\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fwww.coderabbit.ai\u002F?utm_source=fastapi&utm_medium=badge&utm_campaign=fastapi\" target=\"_blank\" title=\"Cut Code Review Time & Bugs in Half with CodeRabbit\">\u003Cimg src=\"https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Fsponsors\u002Fcoderabbit.png\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fsubtotal.com\u002F?utm_source=fastapi&utm_medium=sponsorship&utm_campaign=open-source\" target=\"_blank\" title=\"The Gold Standard in Retail Account Linking\">\u003Cimg src=\"https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Fsponsors\u002Fsubtotal.svg\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fdocs.railway.com\u002Fguides\u002Ffastapi?utm_medium=integration&utm_source=docs&utm_campaign=fastapi\" target=\"_blank\" title=\"Deploy enterprise applications at startup speed\">\u003Cimg src=\"https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Fsponsors\u002Frailway.png\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fserpapi.com\u002F?utm_source=fastapi_website\" target=\"_blank\" title=\"SerpApi: Web Search API\">\u003Cimg src=\"https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Fsponsors\u002Fserpapi.png\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fwww.greptile.com\u002F?utm_source=fastapi&utm_medium=sponsorship&utm_campaign=fastapi_sponsor_page\" target=\"_blank\" title=\"Greptile: The AI Code Reviewer\">\u003Cimg src=\"https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Fsponsors\u002Fgreptile.png\">\u003C\u002Fa>\n\n### Silver Sponsors\n\n\u003Ca href=\"https:\u002F\u002Fdatabento.com\u002F?utm_source=fastapi&utm_medium=sponsor&utm_content=display\" target=\"_blank\" title=\"Pay as you go for market data\">\u003Cimg src=\"https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Fsponsors\u002Fdatabento.svg\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fwww.svix.com\u002F\" target=\"_blank\" title=\"Svix - Webhooks as a service\">\u003Cimg src=\"https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Fsponsors\u002Fsvix.svg\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fwww.stainlessapi.com\u002F?utm_source=fastapi&utm_medium=referral\" target=\"_blank\" title=\"Stainless | Generate best-in-class SDKs\">\u003Cimg src=\"https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Fsponsors\u002Fstainless.png\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fwww.permit.io\u002Fblog\u002Fimplement-authorization-in-fastapi?utm_source=github&utm_medium=referral&utm_campaign=fastapi\" target=\"_blank\" title=\"Fine-Grained Authorization for FastAPI\">\u003Cimg src=\"https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Fsponsors\u002Fpermit.png\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fwww.interviewpal.com\u002F?utm_source=fastapi&utm_medium=open-source&utm_campaign=dev-hiring\" target=\"_blank\" title=\"InterviewPal - AI Interview Coach for Engineers and Devs\">\u003Cimg src=\"https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Fsponsors\u002Finterviewpal.png\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fdribia.com\u002Fen\u002F\" target=\"_blank\" title=\"Dribia - Data Science within your reach\">\u003Cimg src=\"https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Fsponsors\u002Fdribia.png\">\u003C\u002Fa>\n\n\u003C!-- \u002Fsponsors -->\n\n[Other sponsors](https:\u002F\u002Ffastapi.tiangolo.com\u002Ffastapi-people\u002F#sponsors)\n\n## Opinions\n\n\n\n\u003Cdiv class=\"only-github\" markdown=\"1\">\n\n\"_[...] I'm using **FastAPI** a ton these days. [...] I'm actually planning to use it for all of my team's **ML services at Microsoft**. Some of them are getting integrated into the core **Windows** product and some **Office** products._\"\n\n\u003Cdiv style=\"text-align: right; margin-right: 10%;\">Kabir Khan - \u003Cstrong>Microsoft\u003C\u002Fstrong> \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Ffastapi\u002Ffastapi\u002Fpull\u002F26\">\u003Csmall>(ref)\u003C\u002Fsmall>\u003C\u002Fa>\u003C\u002Fdiv>\n\n---\n\n\"_We adopted the **FastAPI** library to spawn a **REST** server that can be queried to obtain **predictions**. [for Ludwig]_\"\n\n\u003Cdiv style=\"text-align: right; margin-right: 10%;\">Piero Molino, Yaroslav Dudin, and Sai Sumanth Miryala - \u003Cstrong>Uber\u003C\u002Fstrong> \u003Ca href=\"https:\u002F\u002Feng.uber.com\u002Fludwig-v0-2\u002F\">\u003Csmall>(ref)\u003C\u002Fsmall>\u003C\u002Fa>\u003C\u002Fdiv>\n\n---\n\n\"_**Netflix** is pleased to announce the open-source release of our **crisis management** orchestration framework: **Dispatch**! [built with **FastAPI**]_\"\n\n\u003Cdiv style=\"text-align: right; margin-right: 10%;\">Kevin Glisson, Marc Vilanova, Forest Monsen - \u003Cstrong>Netflix\u003C\u002Fstrong> \u003Ca href=\"https:\u002F\u002Fnetflixtechblog.com\u002Fintroducing-dispatch-da4b8a2a8072\">\u003Csmall>(ref)\u003C\u002Fsmall>\u003C\u002Fa>\u003C\u002Fdiv>\n\n---\n\n\"_If anyone is looking to build a production Python API, I would highly recommend **FastAPI**. It is **beautifully designed**, **simple to use** and **highly scalable**, it has become a **key component** in our API first development strategy and is driving many automations and services such as our Virtual TAC Engineer._\"\n\n\u003Cdiv style=\"text-align: right; margin-right: 10%;\">Deon Pillsbury - \u003Cstrong>Cisco\u003C\u002Fstrong> \u003Ca href=\"https:\u002F\u002Fwww.linkedin.com\u002Fposts\u002Fdeonpillsbury_cisco-cx-python-activity-6963242628536487936-trAp\u002F\">\u003Csmall>(ref)\u003C\u002Fsmall>\u003C\u002Fa>\u003C\u002Fdiv>\n\n---\n\n\u003C\u002Fdiv>\n\n## FastAPI Conf\n\n[**FastAPI Conf '26**](https:\u002F\u002Ffastapiconf.com) is happening on **October 28, 2026** in **Amsterdam, NL**. All about FastAPI, right from the source. 🎤\n\n\u003Ca class=\"fastapi-feature-banner\" href=\"https:\u002F\u002Ffastapiconf.com\">\u003Cimg src=\"https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Ffastapi-conf.jpeg\" alt=\"FastAPI Conf '26 - October 28, 2026 - Amsterdam, NL\">\u003C\u002Fa>\n\n## FastAPI mini documentary\n\nThere's a [FastAPI mini documentary](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=mpR8ngthqiE) released at the end of 2025, you can watch it online:\n\n\u003Ca class=\"fastapi-feature-banner\" href=\"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=mpR8ngthqiE\">\u003Cimg src=\"https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Ffastapi-documentary.jpg\" alt=\"FastAPI Mini Documentary\">\u003C\u002Fa>\n\n## **Typer**, the FastAPI of CLIs\n\n\u003Ca href=\"https:\u002F\u002Ftyper.tiangolo.com\">\u003Cimg src=\"https:\u002F\u002Ftyper.tiangolo.com\u002Fimg\u002Flogo-margin\u002Flogo-margin-vector.svg\" style=\"width: 20%;\">\u003C\u002Fa>\n\nIf you are building a \u003Cabbr title=\"Command Line Interface\">CLI\u003C\u002Fabbr> app to be used in the terminal instead of a web API, check out [**Typer**](https:\u002F\u002Ftyper.tiangolo.com\u002F).\n\n**Typer** is FastAPI's little sibling. And it's intended to be the **FastAPI of CLIs**. ⌨️ 🚀\n\n## Requirements\n\nFastAPI stands on the shoulders of giants:\n\n* [Starlette](https:\u002F\u002Fwww.starlette.dev\u002F) for the web parts.\n* [Pydantic](https:\u002F\u002Fdocs.pydantic.dev\u002F) for the data parts.\n\n## Installation\n\nCreate and activate a [virtual environment](https:\u002F\u002Ffastapi.tiangolo.com\u002Fvirtual-environments\u002F) and then install FastAPI:\n\n\u003Cdiv class=\"termy\">\n\n```console\n$ pip install \"fastapi[standard]\"\n\n---> 100%\n```\n\n\u003C\u002Fdiv>\n\n**Note**: Make sure you put `\"fastapi[standard]\"` in quotes to ensure it works in all terminals.\n\n## Example\n\n### Create it\n\nCreate a file `main.py` with:\n\n```Python\nfrom fastapi import FastAPI\n\napp = FastAPI()\n\n\n@app.get(\"\u002F\")\ndef read_root():\n    return {\"Hello\": \"World\"}\n\n\n@app.get(\"\u002Fitems\u002F{item_id}\")\ndef read_item(item_id: int, q: str | None = None):\n    return {\"item_id\": item_id, \"q\": q}\n```\n\n\u003Cdetails markdown=\"1\">\n\u003Csummary>Or use \u003Ccode>async def\u003C\u002Fcode>...\u003C\u002Fsummary>\n\nIf your code uses `async` \u002F `await`, use `async def`:\n\n```Python hl_lines=\"7  12\"\nfrom fastapi import FastAPI\n\napp = FastAPI()\n\n\n@app.get(\"\u002F\")\nasync def read_root():\n    return {\"Hello\": \"World\"}\n\n\n@app.get(\"\u002Fitems\u002F{item_id}\")\nasync def read_item(item_id: int, q: str | None = None):\n    return {\"item_id\": item_id, \"q\": q}\n```\n\n**Note**:\n\nIf you don't know, check the _\"In a hurry?\"_ section about [`async` and `await` in the docs](https:\u002F\u002Ffastapi.tiangolo.com\u002Fasync\u002F#in-a-hurry).\n\n\u003C\u002Fdetails>\n\n### Run it\n\nRun the server with:\n\n\u003Cdiv class=\"termy\">\n\n```console\n$ fastapi dev\n\n ╭────────── FastAPI CLI - Development mode ───────────╮\n │                                                     │\n │  Serving at: http:\u002F\u002F127.0.0.1:8000                  │\n │                                                     │\n │  API docs: http:\u002F\u002F127.0.0.1:8000\u002Fdocs               │\n │                                                     │\n │  Running in development mode, for production use:   │\n │                                                     │\n │  fastapi run                                        │\n │                                                     │\n ╰─────────────────────────────────────────────────────╯\n\nINFO:     Will watch for changes in these directories: ['\u002Fhome\u002Fuser\u002Fcode\u002Fawesomeapp']\nINFO:     Uvicorn running on http:\u002F\u002F127.0.0.1:8000 (Press CTRL+C to quit)\nINFO:     Started reloader process [2248755] using WatchFiles\nINFO:     Started server process [2248757]\nINFO:     Waiting for application startup.\nINFO:     Application startup complete.\n```\n\n\u003C\u002Fdiv>\n\n\u003Cdetails markdown=\"1\">\n\u003Csummary>About the command \u003Ccode>fastapi dev\u003C\u002Fcode>...\u003C\u002Fsummary>\n\nThe command `fastapi dev` reads your `main.py` file automatically, detects the **FastAPI** app in it, and starts a server using [Uvicorn](https:\u002F\u002Fwww.uvicorn.dev).\n\nBy default, `fastapi dev` will start with auto-reload enabled for local development.\n\nYou can read more about it in the [FastAPI CLI docs](https:\u002F\u002Ffastapi.tiangolo.com\u002Ffastapi-cli\u002F).\n\n\u003C\u002Fdetails>\n\n### Check it\n\nOpen your browser at [http:\u002F\u002F127.0.0.1:8000\u002Fitems\u002F5?q=somequery](http:\u002F\u002F127.0.0.1:8000\u002Fitems\u002F5?q=somequery).\n\nYou will see the JSON response as:\n\n```JSON\n{\"item_id\": 5, \"q\": \"somequery\"}\n```\n\nYou already created an API that:\n\n* Receives HTTP requests in the _paths_ `\u002F` and `\u002Fitems\u002F{item_id}`.\n* Both _paths_ take `GET` \u003Cem>operations\u003C\u002Fem> (also known as HTTP _methods_).\n* The _path_ `\u002Fitems\u002F{item_id}` has a _path parameter_ `item_id` that should be an `int`.\n* The _path_ `\u002Fitems\u002F{item_id}` has an optional `str` _query parameter_ `q`.\n\n### Interactive API docs\n\nNow go to [http:\u002F\u002F127.0.0.1:8000\u002Fdocs](http:\u002F\u002F127.0.0.1:8000\u002Fdocs).\n\nYou will see the automatic interactive API documentation (provided by [Swagger UI](https:\u002F\u002Fgithub.com\u002Fswagger-api\u002Fswagger-ui)):\n\n![Swagger UI](https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Findex\u002Findex-01-swagger-ui-simple.png)\n\n### Alternative API docs\n\nAnd now, go to [http:\u002F\u002F127.0.0.1:8000\u002Fredoc](http:\u002F\u002F127.0.0.1:8000\u002Fredoc).\n\nYou will see the alternative automatic documentation (provided by [ReDoc](https:\u002F\u002Fgithub.com\u002FRebilly\u002FReDoc)):\n\n![ReDoc](https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Findex\u002Findex-02-redoc-simple.png)\n\n## Example upgrade\n\nNow modify the file `main.py` to receive a body from a `PUT` request.\n\nDeclare the body using standard Python types, thanks to Pydantic.\n\n```Python hl_lines=\"2  7-10 23-25\"\nfrom fastapi import FastAPI\nfrom pydantic import BaseModel\n\napp = FastAPI()\n\n\nclass Item(BaseModel):\n    name: str\n    price: float\n    is_offer: bool | None = None\n\n\n@app.get(\"\u002F\")\ndef read_root():\n    return {\"Hello\": \"World\"}\n\n\n@app.get(\"\u002Fitems\u002F{item_id}\")\ndef read_item(item_id: int, q: str | None = None):\n    return {\"item_id\": item_id, \"q\": q}\n\n\n@app.put(\"\u002Fitems\u002F{item_id}\")\ndef update_item(item_id: int, item: Item):\n    return {\"item_name\": item.name, \"item_id\": item_id}\n```\n\nThe `fastapi dev` server should reload automatically.\n\n### Interactive API docs upgrade\n\nNow go to [http:\u002F\u002F127.0.0.1:8000\u002Fdocs](http:\u002F\u002F127.0.0.1:8000\u002Fdocs).\n\n* The interactive API documentation will be automatically updated, including the new body:\n\n![Swagger UI](https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Findex\u002Findex-03-swagger-02.png)\n\n* Click on the button \"Try it out\", it allows you to fill the parameters and directly interact with the API:\n\n![Swagger UI interaction](https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Findex\u002Findex-04-swagger-03.png)\n\n* Then click on the \"Execute\" button, the user interface will communicate with your API, send the parameters, get the results and show them on the screen:\n\n![Swagger UI interaction](https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Findex\u002Findex-05-swagger-04.png)\n\n### Alternative API docs upgrade\n\nAnd now, go to [http:\u002F\u002F127.0.0.1:8000\u002Fredoc](http:\u002F\u002F127.0.0.1:8000\u002Fredoc).\n\n* The alternative documentation will also reflect the new query parameter and body:\n\n![ReDoc](https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Findex\u002Findex-06-redoc-02.png)\n\n### Recap\n\nIn summary, you declare **once** the types of parameters, body, etc. as function parameters.\n\nYou do that with standard modern Python types.\n\nYou don't have to learn a new syntax, the methods or classes of a specific library, etc.\n\nJust standard **Python**.\n\nFor example, for an `int`:\n\n```Python\nitem_id: int\n```\n\nor for a more complex `Item` model:\n\n```Python\nitem: Item\n```\n\n...and with that single declaration you get:\n\n* Editor support, including:\n    * Completion.\n    * Type checks.\n* Validation of data:\n    * Automatic and clear errors when the data is invalid.\n    * Validation even for deeply nested JSON objects.\n* \u003Cdfn title=\"also known as: serialization, parsing, marshalling\">Conversion\u003C\u002Fdfn> of input data: coming from the network to Python data and types. Reading from:\n    * JSON.\n    * Path parameters.\n    * Query parameters.\n    * Cookies.\n    * Headers.\n    * Forms.\n    * Files.\n* \u003Cdfn title=\"also known as: serialization, parsing, marshalling\">Conversion\u003C\u002Fdfn> of output data: converting from Python data and types to network data (as JSON):\n    * Convert Python types (`str`, `int`, `float`, `bool`, `list`, etc).\n    * `datetime` objects.\n    * `UUID` objects.\n    * Database models.\n    * ...and many more.\n* Automatic interactive API documentation, including 2 alternative user interfaces:\n    * Swagger UI.\n    * ReDoc.\n\n---\n\nComing back to the previous code example, **FastAPI** will:\n\n* Validate that there is an `item_id` in the path for `GET` and `PUT` requests.\n* Validate that the `item_id` is of type `int` for `GET` and `PUT` requests.\n    * If it is not, the client will see a useful, clear error.\n* Check if there is an optional query parameter named `q` (as in `http:\u002F\u002F127.0.0.1:8000\u002Fitems\u002Ffoo?q=somequery`) for `GET` requests.\n    * As the `q` parameter is declared with `= None`, it is optional.\n    * Without the `None` it would be required (as is the body in the case with `PUT`).\n* For `PUT` requests to `\u002Fitems\u002F{item_id}`, read the body as JSON:\n    * Check that it has a required attribute `name` that should be a `str`.\n    * Check that it has a required attribute `price` that has to be a `float`.\n    * Check that it has an optional attribute `is_offer`, that should be a `bool`, if present.\n    * All this would also work for deeply nested JSON objects.\n* Convert from and to JSON automatically.\n* Document everything with OpenAPI, that can be used by:\n    * Interactive documentation systems.\n    * Automatic client code generation systems, for many languages.\n* Provide 2 interactive documentation web interfaces directly.\n\n---\n\nWe just scratched the surface, but you already get the idea of how it all works.\n\nTry changing the line with:\n\n```Python\n    return {\"item_name\": item.name, \"item_id\": item_id}\n```\n\n...from:\n\n```Python\n        ... \"item_name\": item.name ...\n```\n\n...to:\n\n```Python\n        ... \"item_price\": item.price ...\n```\n\n...and see how your editor will auto-complete the attributes and know their types:\n\n![editor support](https:\u002F\u002Ffastapi.tiangolo.com\u002Fimg\u002Fvscode-completion.png)\n\nFor a more complete example including more features, see the \u003Ca href=\"https:\u002F\u002Ffastapi.tiangolo.com\u002Ftutorial\u002F\">Tutorial - User Guide\u003C\u002Fa>.\n\n**Spoiler alert**: the tutorial - user guide includes:\n\n* Declaration of **parameters** from other different places as: **headers**, **cookies**, **form fields** and **files**.\n* How to set **validation constraints** as `maximum_length` or `regex`.\n* A very powerful and easy to use **\u003Cdfn title=\"also known as components, resources, providers, services, injectables\">Dependency Injection\u003C\u002Fdfn>** system.\n* Security and authentication, including support for **OAuth2** with **JWT tokens** and **HTTP Basic** auth.\n* More advanced (but equally easy) techniques for declaring **deeply nested JSON models** (thanks to Pydantic).\n* **GraphQL** integration with [Strawberry](https:\u002F\u002Fstrawberry.rocks) and other libraries.\n* Many extra features (thanks to Starlette) as:\n    * **WebSockets**\n    * extremely easy tests based on HTTPX and `pytest`\n    * **CORS**\n    * **Cookie Sessions**\n    * ...and more.\n\n### Deploy your app (optional)\n\nYou can optionally deploy your FastAPI app to [FastAPI Cloud](https:\u002F\u002Ffastapicloud.com), go and join the waiting list if you haven't. 🚀\n\nIf you already have a **FastAPI Cloud** account (we invited you from the waiting list 😉), you can deploy your application with one command.\n\n\u003Cdiv class=\"termy\">\n\n```console\n$ fastapi deploy\n\nDeploying to FastAPI Cloud...\n\n✅ Deployment successful!\n\n🐔 Ready the chicken! Your app is ready at https:\u002F\u002Fmyapp.fastapicloud.dev\n```\n\n\u003C\u002Fdiv>\n\nThat's it! Now you can access your app at that URL. ✨\n\n#### About FastAPI Cloud\n\n**[FastAPI Cloud](https:\u002F\u002Ffastapicloud.com)** is built by the same author and team behind **FastAPI**.\n\nIt streamlines the process of **building**, **deploying**, and **accessing** an API with minimal effort.\n\nIt brings the same **developer experience** of building apps with FastAPI to **deploying** them to the cloud. 🎉\n\nFastAPI Cloud is the primary sponsor and funding provider for the *FastAPI and friends* open source projects. ✨\n\n#### Deploy to other cloud providers\n\nFastAPI is open source and based on standards. You can deploy FastAPI apps to any cloud provider you choose.\n\nFollow your cloud provider's guides to deploy FastAPI apps with them. 🤓\n\n## Performance\n\nIndependent TechEmpower benchmarks show **FastAPI** applications running under Uvicorn as [one of the fastest Python frameworks available](https:\u002F\u002Fwww.techempower.com\u002Fbenchmarks\u002F#section=test&runid=7464e520-0dc2-473d-bd34-dbdfd7e85911&hw=ph&test=query&l=zijzen-7), only below Starlette and Uvicorn themselves (used internally by FastAPI). (*)\n\nTo understand more about it, see the section [Benchmarks](https:\u002F\u002Ffastapi.tiangolo.com\u002Fbenchmarks\u002F).\n\n## Dependencies\n\nFastAPI depends on Pydantic and Starlette.\n\n### `standard` Dependencies\n\nWhen you install FastAPI with `pip install \"fastapi[standard]\"` it comes with the `standard` group of optional dependencies:\n\nUsed by Pydantic:\n\n* [`email-validator`](https:\u002F\u002Fgithub.com\u002FJoshData\u002Fpython-email-validator) - for email validation.\n\nUsed by Starlette:\n\n* [`httpx`](https:\u002F\u002Fwww.python-httpx.org) - Required if you want to use the `TestClient`.\n* [`jinja2`](https:\u002F\u002Fjinja.palletsprojects.com) - Required if you want to use the default template configuration.\n* [`python-multipart`](https:\u002F\u002Fgithub.com\u002FKludex\u002Fpython-multipart) - Required if you want to support form \u003Cdfn title=\"converting the string that comes from an HTTP request into Python data\">\"parsing\"\u003C\u002Fdfn>, with `request.form()`.\n\nUsed by FastAPI:\n\n* [`uvicorn`](https:\u002F\u002Fwww.uvicorn.dev) - for the server that loads and serves your application. This includes `uvicorn[standard]`, which includes some dependencies (e.g. `uvloop`) needed for high performance serving.\n* `fastapi-cli[standard]` - to provide the `fastapi` command.\n    * This includes `fastapi-cloud-cli`, which allows you to deploy your FastAPI application to [FastAPI Cloud](https:\u002F\u002Ffastapicloud.com).\n\n### Without `standard` Dependencies\n\nIf you don't want to include the `standard` optional dependencies, you can install with `pip install fastapi` instead of `pip install \"fastapi[standard]\"`.\n\n### Without `fastapi-cloud-cli`\n\nIf you want to install FastAPI with the standard dependencies but without the `fastapi-cloud-cli`, you can install with `pip install \"fastapi[standard-no-fastapi-cloud-cli]\"`.\n\n### Additional Optional Dependencies\n\nThere are some additional dependencies you might want to install.\n\nAdditional optional Pydantic dependencies:\n\n* [`pydantic-settings`](https:\u002F\u002Fdocs.pydantic.dev\u002Flatest\u002Fusage\u002Fpydantic_settings\u002F) - for settings management.\n* [`pydantic-extra-types`](https:\u002F\u002Fdocs.pydantic.dev\u002Flatest\u002Fusage\u002Ftypes\u002Fextra_types\u002Fextra_types\u002F) - for extra types to be used with Pydantic.\n\nAdditional optional FastAPI dependencies:\n\n* [`orjson`](https:\u002F\u002Fgithub.com\u002Fijl\u002Forjson) - Required if you want to use `ORJSONResponse`.\n* [`ujson`](https:\u002F\u002Fgithub.com\u002Fesnme\u002Fultrajson) - Required if you want to use `UJSONResponse`.\n\n## License\n\nThis project is licensed under the terms of the MIT license.\n","FastAPI 是一个用于构建 API 的现代、高性能 Web 框架，基于 Python 标准类型提示。其核心功能包括极高的性能（与 NodeJS 和 Go 相当）、快速开发能力（提高约 200% 至 300% 的开发速度）以及减少约 40% 的人为错误。FastAPI 提供了直观的编辑器支持和自动补全功能，使得调试时间大大减少，并且易于学习和使用。此外，它还具备自动生成交互式文档的功能，遵循 OpenAPI 和 JSON Schema 等开放标准。FastAPI 适用于需要快速开发、高并发处理能力和良好文档支持的各种 API 开发场景，如微服务架构、后端服务等。",2,"2026-06-11 02:34:17","top_all"]