Skip to content

API rate limiting

Docs Preview

This is unreleased documentation for Traefik Hub!

This page explains how to use the Traefik Hub UI to apply rate limiting to APIs.


Introduction

In this tutorial, you'll learn how to apply rate limiting to an API using the UI.

Applying a rate limit to an API is a three-step process.

You will learn how to define a rate limit by configuring the number of allowed requests, setting a time period and assigning the rate limit to a user group.


Before you begin

Before getting started, please make sure to read the general documentation about rate limiting to understand how rate limiting works.


Create a new rate limit

If you haven't done already, login into the Traefik Hub UI.

First, select API rate limits in the left navigation menu.

Select API rate limits button

Select API rate limits

This is your overview page about all configured rate limits.

In the next step, select Create rate limit in the top right corner.

Select create rate limit

Select Create rate limit

An API can have multiple rate limit policies.
For example you could have two (or more) policies with a different number of allowed requests.

For this reason you always have to select API(s) and user group(s).

In the next steps, you will:

  • Name the new rate limit policy: travel-agents-rate-limit
  • Choose the Traefik Hub agent where the API for the new rate limit policy is hosted: demo-agent
  • Set a limit for requests: 200
  • Configure a time limit for requests: One minute
  • Select the API to which the rate limit will apply: all APIs with the label area:flights
  • Select the user group(s) which will be rate limited: travel-agents

API rate limit example

Example

Once you're done, select Create.

Congratulations, you created your first API rate limit policy and assigned it to a user group.


What's next