> ## Content Index
> Fetch the complete content index at: https://reactpractice.dev/llms.txt
> Use this file to discover other available public pages before exploring further.

# Using Swagger to explore an API
- URL: https://reactpractice.dev/articles/using-swagger-to-explore-an-api/
- Published: 2025-02-15T08:23:50.000Z
- Updated: 2026-06-01T01:58:37.000Z
- Author: Corina Udrescu
- Tags: Articles, #corina-2, Working with APIs, #Import 2026-06-09 12:07

When working with an API, it's essential to have access to its documentation, so you can see what endpoints are available, what parameters are supported and what responses you can expect.

One common interface for documenting an API is using [Swagger](https://swagger.io/?ref=reactpractice.dev) \- a live documentation that allows you to also try out the endpoints!

One free API that I know of that uses Swagger is the [OpenHolidaysAPI](https://www.openholidaysapi.org/en/?ref=reactpractice.dev).

Their Swagger environment is available at [https://openholidaysapi.org/swagger/index.html](https://openholidaysapi.org/swagger/index.html?ref=reactpractice.dev).  
Let's use it to showcase some of the Swagger features.

### Trying out an endpoint in Swagger

By default, you can see a list of all available API endpoints. If you click to expand one, you'll notice a button to "Try it out" on the right side. Clicking it will make all the API parameter fields editable, so you can pass what values you want!

![](https://storage.ghost.io/c/7c/fc/7cfc444f-a1c9-4dd3-a87e-8dcc2f1180be/content/images/2025/02/2-swagger-try-it-out.png)

Next, after filling in the values, if you click "Execute", this will call the endpoint with the parameters you passed:

![](https://storage.ghost.io/c/7c/fc/7cfc444f-a1c9-4dd3-a87e-8dcc2f1180be/content/images/2025/02/3-get-holidays.png)

Finally, you can see the response the server returned! In our case, the request was valid, so we get the list of countries.

![](https://storage.ghost.io/c/7c/fc/7cfc444f-a1c9-4dd3-a87e-8dcc2f1180be/content/images/2025/02/4-holidays-response.png)

If you scroll below, you can also see what error codes the endpoint returns, so you can add proper error handling.

---

Did you ever use Swagger in your projects? Was it helpful?  
Share your experience in the comments below.

> Do you want to try this out for yourself?  
> Try building the "[Public Holidays app](https://reactpractice.dev/exercise/build-a-public-holidays-app/)" challenge!