Saltar al contenido principal
ProductosHerramientas de escritorioTASTECADRevisión de planosTASTEFILESGestión de archivosTASTEFTPTransferencia de archivosTASTESSHEspacio de trabajo remotoTASTEZIPCompresión y extracciónHerramientas para desarrolladoresTASTECODEEntorno de desarrollo integrado para RustTASTESTUDIOEntorno integrado de desarrollo y pruebasTASTEETLIntegración de datos (ETL)ServidoresTASTEREMOTEServidor de escritorio remotoTASTEGEOServidor geoespacialTASTEMAILEspacio de trabajo de correoEmpezarDescargasDocumentaciónComprarTodos los productos
Marketplace
Noticias
TecnologíaNoticiasNoticias de desarrollo de hoyDocumentaciónLenguajes de programaciónRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartFrameworks web frontendNext.jsReactVue.js · NuxtSvelteKitAngularFrameworks de servidorSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressFrameworks de apps y escritorioTauriFlutterReact NativeElectronAlgoritmosFundamentos de algoritmosAlgoritmos esencialesAlgoritmos avanzadosAlgoritmos prácticos
ComunidadProyectosRegistros de desarrolloPromptsProblemas con herramientas de IAEscaparateGuía de la comunidad
ColaboraTransferencia técnicaDesarrollo de sitio webDesarrollo de app de escritorioCanal de lanzamiento y pagosSocio de ventasContacto
ServiciosEscritorio remotoPaquetes de instalación a medida
TASTEDEV
Productos

Herramientas de escritorio

TASTECADAbre planos complejos con ligerezaTASTEFILESSolo los archivos que necesitas, lo más rápido posibleTASTEFTPEl camino más limpio para tus archivosTASTESSHEntre tu servidor y tú, una conexión más sólidaTASTEZIPComprime más rápido, descomprime más seguro

Herramientas para desarrolladores

TASTECODEEdita, compila, depura y prueba apps de Rust en una sola ventanaTASTESTUDIODe la edición a las pruebas remotas y las correcciones con IA aprobadasTASTEETLMueve datos viendo sus valores

Servidores

TASTEREMOTEUn escritorio remoto que funciona en tu propio servidorTASTEGEOUn servidor geoespacial compatible con GeoServer, reconstruido en RustTASTEMAILRecupera el control de tu correo

Empezar

DescargasÚltimas versiones de cada productoDocsCómo usar cada productoComprarSuscripciones y licencias perpetuasTodos los productosTodos los productos de un vistazo
Todos los productos
MarketplaceNoticias
Tecnología

Noticias

Noticias de desarrollo de hoyAnuncios oficiales de lenguajes, frameworks, GitHub e IADocumentaciónGuías de lenguajes, frameworks y algoritmos

Lenguajes de programación

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Frameworks

Frameworks web frontendNext.jsReactVue.js · NuxtSvelteKitAngular
Frameworks de servidorSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
Frameworks de apps y escritorioTauriFlutterReact NativeElectron

Algoritmos

Fundamentos de algoritmosAnálisis de complejidad · Ordenamiento · Búsqueda · Estructuras de datos básicas · Árboles y montículosAlgoritmos esencialesRecorrido de grafos · Camino mínimo y árbol generador mínimo · Programación dinámica · Algoritmos voraces · Divide y vencerás · Backtracking (vuelta atrás)Algoritmos avanzadosAlgoritmos de cadenas · Matemáticas y teoría de números · Manipulación de bits · Árboles de segmentos · Union-FindAlgoritmos prácticosEstrategia para entrevistas de código · Caché LRU · Limitación de tasa · Hashing consistente
Toda la documentación de desarrollo
Comunidad
ProyectosDescubre creadores y su trabajoRegistros de desarrolloDecisiones y aprendizajesPromptsInstrucciones reutilizablesProblemas con herramientas de IAProblemas y alternativas de Claude, Codex, GeminiEscaparateResultados terminadosGuía de la comunidadCómo construimos en abierto
Colabora
Transferencia técnicaApps nativas con Rust y eguiDesarrollo de sitio web10 idiomas, cuentas, documentación y descargasDesarrollo de app de escritorioRust y egui, sin WebViewCanal de lanzamiento y pagosFirma, MSI, deb, rpm, AppImage, hashesSocio de ventasRecomiéndanos y gana el 30 %ContactoDesarrollo, alianzas e inversión
Servicios
Escritorio remotoAccede a tu ordenador desde el navegadorPaquetes de instalación a medidaSolo lo necesario, ajustes precargados
Comprar
ES
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Iniciar sesión
Iniciar sesión
TASTEDEV

De pequeñas herramientas a un mejor desarrollo.

support@tastedev.netApoyar a TASTEDEV
ProductosLínea de productosComprarDocsDescargasMarketplaceSoporte
ComunidadProyectosRegistros de desarrolloPromptsProblemas con herramientas de IAEscaparate
PolíticasPolítica de privacidadTérminos de servicioCondiciones de suscripciónReembolsosNormas de la comunidad
CuentaIniciar sesiónRegistrarse
Visitantes
Hoy
012345678901234567890123456789012345678901234567890123456789
Ayer
012345678901234567890123456789012345678901234567890123456789
Vistas totales
0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
Empresa
GXSOFT
Representante
CHOI YOUNG GU
Número de registro mercantil
853-44-00368
Dirección
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Teléfono
+82-10-4404-1523
Correo electrónico
whitecalvin@tastedev.net
Responsable de privacidad
CHOI YOUNG GU

© 2026 TASTEDEVLa información de los productos se basa en fuentes de desarrollo verificadas.Publicado · en mejora

Documentación de FastAPI
FastAPI
Getting Started with FastAPIProject StructureCore ConceptsData and StateTestingDeployment
Debates

Guía de FastAPI · 1/6

Getting Started with FastAPI

Por ahora, este capítulo solo está disponible en inglés.

This chapter takes you from installing FastAPI to running your first API on the development server. Along the way you will look at the API documentation FastAPI generates for you and set up your editor.

Prerequisites

FastAPI is a Python library, so you need Python installed first. Because FastAPI leans heavily on type hints, use a recent Python release within the range the official documentation supports. Check your version in a terminal:

python --version
# On Windows, if the python command is missing
py --version

Create a virtual environment

A virtual environment keeps each project's dependencies separate. Create a project folder, create a .venv environment inside it and activate it.

mkdir hello-fastapi
cd hello-fastapi
python -m venv .venv

# macOS and Linux
source .venv/bin/activate

# Windows PowerShell
.venv\Scripts\Activate.ps1

Once it is active, your prompt shows (.venv) and anything you install with pip stays inside this folder. Run deactivate when you are done.

Install FastAPI

The recommended way to install FastAPI is with the standard extras. They pull in the commonly used dependencies: the Uvicorn ASGI server, the fastapi command-line tool, HTTPX for testing and python-multipart for form handling.

pip install "fastapi[standard]"

Quote the package name, since some shells treat square brackets specially. To pin what you installed, run pip freeze > requirements.txt, then reproduce the same environment elsewhere with pip install -r requirements.txt. Tools such as uv or Poetry work just as well; with them you list dependencies in pyproject.toml.

Write your first API

Create main.py in the project folder:

from fastapi import FastAPI

app = FastAPI()


@app.get("/")
def read_root():
    return {"message": "Hello, world!"}


@app.get("/items/{item_id}")
def read_item(item_id: int, q: str | None = None):
    return {"item_id": item_id, "q": q}

The app object created by FastAPI() represents your whole application. A function decorated with an HTTP method, such as @app.get("/"), is called a path operation function. Whatever it returns, whether a dict, a list or a Pydantic model, is converted to a JSON response automatically.

In the second function, {item_id} is a path parameter, and the item_id: int annotation tells FastAPI to convert and validate it as an integer. A request to /items/abc never reaches your function: the client gets a 422 response with JSON explaining exactly what was wrong. Because has a default value, it becomes an optional query parameter such as .

¿Tienes preguntas sobre este capítulo?
Capítulo siguienteProject Structure
q
?q=hello

Run the development server

Start the development server with fastapi dev:

fastapi dev main.py

The terminal shows the server address, the docs URL and the app object it found. In development mode the server restarts every time you save a file, and it listens on http://127.0.0.1:8000 by default. Press Ctrl+C to stop it. Add --port 8080 to use another port. Try it from a browser or with curl:

curl http://127.0.0.1:8000/
curl "http://127.0.0.1:8000/items/5?q=hello"

Automatic API docs

FastAPI builds an OpenAPI schema from your code and serves two documentation UIs out of the box:

URLWhat you get
/docsSwagger UI, where you can call each endpoint from the browser
/redocReDoc, a clean reference-style view
/openapi.jsonThe raw OpenAPI schema as JSON

In /docs, expand an endpoint and click "Try it out" to fill in parameters, send a request and see the response. When you change the code, the docs change with it.

Editor setup

Since FastAPI is driven by type hints, an editor that understands types gives you excellent completion and inline errors.

  • VS Code: install Microsoft's Python extension with Pylance, then choose the interpreter inside .venv via "Python: Select Interpreter".
  • PyCharm: set .venv as the project interpreter and completion and type checking work for FastAPI code.
  • Add Ruff for formatting and linting, and mypy for static type checking.

Summary

  • Create a virtual environment and install with pip install "fastapi[standard]".
  • Define path operations with a FastAPI() app and decorators such as @app.get.
  • Run fastapi dev main.py for a development server that reloads on changes.
  • Explore the generated interactive docs at /docs and /redoc.

0 comentarios

Comentarios destacadosMás recientes primero

Iniciar sesión · Inicia sesión para dejar un comentario.