Swagger is used for describing REST APIs. Originally, it was created to define APIs programmatically. Swagger APIs follow the REST paradigm and can be described programmatically with the OpenAPI specification. This helps with automatic API documentation, testing, and development.