Application programming interface (api) request throttling
Abstract
Disclosed are systems, methods, and non-transitory computer-readable media for application programming interface (API) request throttling. A method includes receiving a current API request having originated from an Internet Protocol (IP) address, determining a counter value of previous API requests that originated from the IP address and resulted in error, determining, based on the counter value of the previous API requests that originated from the IP address and resulted in error, to apply a delay to a processing of the current API request, and a length of the delay to apply to the processing of the current API request, causing the delay to be applied to the processing of the current API request using the determined length, and in response to determining that the delay has completed, causing the processing of the current API request to resume.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A method comprising:
receiving a current Application Programming Interface (API) request having originated from an Internet Protocol (IP) address; determining a counter value of previous API requests that originated from the IP address and resulted in error; determining, based on the counter value of the previous API requests that originated from the IP address and resulted in error, to apply a delay to a processing of the current API request, and a length of the delay to apply to the processing of the current API request; causing the delay to be applied to the processing of the current API request using the determined length; and in response to determining that the delay has completed, causing the processing of the current API request to resume.
2 . The method of claim 1 , wherein each of the previous APIs is associated with a response comprising a response code indicating whether a respective previous API request originated from the IP address has resulted in error.
3 . The method of claim 1 , wherein the processing of the current API request comprises:
forwarding the current API request to a resource based on a request path included in the API request; receiving an API response from the resource in response to the current API request; transmitting the API response to the originating IP address; and updating the previous API requests that originated from the IP address based on the API response.
4 . The method of claim 1 , wherein determining, based on the counter value of the previous API requests that originated from the IP address and resulted in error, to apply the delay to the processing of the current API request, and the length of the delay to apply to the processing of the current API request comprises:
determining that the counter value of the previous API requests that originated from the IP address and resulted in error satisfies a threshold criterion.
5 . The method of claim 4 , further comprising:
receiving a second API request having originated from the IP address; determining an updated counter value based on previous API requests having originated from the IP address; determining, based on the updated counter value, to apply a second delay using a second length in relation to the second API request; and causing the second delay to be applied to the processing of the second API request using the second length.
6 . The method of claim 5 , wherein determining, based on the updated counter value, to apply the second delay using the second length in relation to the second API request comprises:
determining that the updated counter value of the second API request that originated from the IP address and resulted in error satisfies a second threshold criterion, wherein the second threshold criterion is higher than the threshold criterion, and the length of the delay is different than the second length of the second delay.
7 . The method of claim 1 , further comprising:
receiving a second API request having originated from the IP address; determining an updated counter value based on previous API requests having originated from the IP address; and determining, based on the updated counter value, to process the second API request without initiating the delay.
8 . The method of claim 1 , wherein determining the counter value comprises:
determining a number of the previous API requests having originated from the IP address and having produced one or more responses comprising a response code indicating that the previous API requests originated from the IP address have resulted in a matching error.
9 . A system comprising:
a memory; and one or more processors, coupled to the memory to perform operations comprising: receiving a current Application Programming Interface (API) request having originated from an Internet Protocol (IP) address; determining a counter value of previous API requests that originated from the IP address and resulted in error; determining, based on the counter value of the previous API requests that originated from the IP address and resulted in error, to apply a delay to a processing of the current API request, and a length of the delay to apply to the processing of the current API request; causing the delay to be applied to the processing of the current API request using the determined length; and in response to determining that the delay has completed, causing the processing of the current API request to resume.
10 . The system of claim 9 , wherein each of the previous APIs is associated with a response comprising a response code indicating whether a respective previous API request originated from the IP address has resulted in error.
11 . The system of claim 9 , wherein the processing of the current API request comprises:
forwarding the current API request to a resource based on a request path included in the API request; receiving an API response from the resource in response to the current API request; transmitting the API response to the originating IP address; and updating the previous API requests that originated from the IP address based on the API response.
12 . The system of claim 9 , wherein determining, based on the counter value of the previous API requests that originated from the IP address and resulted in error, to apply the delay to the processing of the current API request, and the length of the delay to apply to the processing of the current API request comprises:
determining that the counter value of the previous API requests that originated from the IP address and resulted in error satisfies a threshold criterion.
13 . The system of claim 12 , the operations further comprising:
receiving a second API request having originated from the IP address; determining an updated counter value based on previous API requests having originated from the IP address; determining, based on the updated counter value, to apply a second delay using a second length in relation to the second API request; and causing the second delay to be applied to the processing of the second API request using the second length.
14 . The system of claim 13 , wherein determining, based on the updated counter value, to apply the second delay using the second length in relation to the second API request comprises:
determining that the updated counter value of the second API request that originated from the IP address and resulted in error satisfies a second threshold criterion, wherein the second threshold criterion is higher than the threshold criterion, and the length of the delay is different than the second length of the second delay.
15 . The system of claim 9 , the operations further comprising:
receiving a second API request having originated from the IP address; determining an updated counter value based on previous API requests having originated from the IP address; and determining, based on the updated counter value, to process the second API request without initiating the delay.
16 . The system of claim 9 , wherein determining the counter value comprises:
determining a number of the previous API requests having originated from the IP address and having produced one or more responses comprising a response code indicating that the previous API requests originated from the IP address have resulted in a matching error.
17 . A non-transitory computer-readable medium storing instructions that, when executed by one or more processors, cause the one or more processors to perform operations comprising:
receiving a current Application Programming Interface (API) request having originated from an Internet Protocol (IP) address; determining a counter value of previous API requests that originated from the IP address and resulted in error; determining, based on the counter value of the previous API requests that originated from the IP address and resulted in error, to apply a delay to a processing of the current API request, and a length of the delay to apply to the processing of the current API request; causing the delay to be applied to the processing of the current API request using the determined length; and in response to determining that the delay has completed, causing the processing of the current API request to resume.
18 . The non-transitory computer-readable medium of claim 17 , wherein the processing of the current API request comprises:
forwarding the current API request to a resource based on a request path included in the API request; receiving an API response from the resource in response to the current API request; transmitting the API response to the originating IP address; and updating the previous API requests that originated from the IP address based on the API response.
19 . The non-transitory computer-readable medium of claim 17 , the operations further comprising:
receiving a second API request having originated from the IP address; determining an updated counter value based on previous API requests having originated from the IP address; determining, based on the updated counter value, to apply a second delay using a second length in relation to the second API request; and causing the second delay to be applied to the processing of the second API request using the second length.
20 . The non-transitory computer-readable medium of claim 17 , the operations further comprising:
receiving a second API request having originated from the IP address; determining an updated counter value based on previous API requests having originated from the IP address; and determining, based on the updated counter value, to process the second API request without initiating the delay.Join the waitlist — get patent alerts
Track US2023385099A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.