Difference between revisions of "API Access"

From Anime Characters Database Wiki
Jump to navigation Jump to search
(Second, you need to rate limit your requests.)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
Do you have a project that could benefit from the data on Anime Characters Database? As a way to help pay the server bills, I offer my services to develop a custom API to suit for your needs for a small fee.
+
 
[[Contact Rei]] for more info.
 
  
 
  [http://www.animecharactersdatabase.com/api_series_characters.php Current API Tools]
 
  [http://www.animecharactersdatabase.com/api_series_characters.php Current API Tools]
Line 15: Line 14:
  
 
===Second, you need to rate limit your requests.===
 
===Second, you need to rate limit your requests.===
 +
Respectfully, limit your bot to 1 request per second.
 +
 +
Our nginx.conf limits as of January 20th 2021 are:
 +
limit_req_zone $binary_remote_addr zone=one:10m rate=5r/s;
 +
limit_req_zone $server_name zone=fast:10m rate=90r/s;
 +
limit_req zone=one burst=10;
 +
limit_req zone=fast burst=200;
  
NGINX handles rate limiting. Respectfully, limit your bot to 1 request per second.
+
==Changes==
    limit_req_zone $binary_remote_addr zone=one:10m rate=5r/s;
+
January 20th 2021
    limit_req_zone $server_name zone=fast:10m rate=90r/s;
+
When requesting birthdays
            limit_req zone=one burst=10;
+
*character_image now returns the full sized character image
            limit_req zone=fast burst=200;
+
*character_thumb has been added to return the character thumb instead

Latest revision as of 12:15, 25 August 2021


Current API Tools

How Not To Get Banned[edit]

First, you need to set a HTTP_USER_AGENT for the tool you will be accessing ACDB from.[edit]

You will get errors like ( 402 Payment Required ) if Python,Perl,etc is in your user agent.

If you leave it with the default, you will be joining a pool of people who also left it default, and together may pose a DDoS threat. This is why I auto ban curl/python/wget any any other popular tool.

To safely check your user agent, visit this page: https://www.animecharactersdatabase.com/vars.php

Second, you need to rate limit your requests.[edit]

Respectfully, limit your bot to 1 request per second.

Our nginx.conf limits as of January 20th 2021 are:

limit_req_zone $binary_remote_addr zone=one:10m rate=5r/s;
limit_req_zone $server_name zone=fast:10m rate=90r/s;
limit_req zone=one burst=10;
limit_req zone=fast burst=200;

Changes[edit]

January 20th 2021

When requesting birthdays

  • character_image now returns the full sized character image
  • character_thumb has been added to return the character thumb instead