Difference between revisions of "Yugipedia:API"

From Yugipedia
Jump to: navigation, search
(create)
 
(Other points: Discord for feedback, too)
 
(One intermediate revision by the same user not shown)
Line 11: Line 11:
  
 
== Updating data ==
 
== Updating data ==
Certain tasks done via the API, such as automatically building and maintaining a card database, may require information to be updated more often than every 30 days. In these cases, instead of simply rerequesting the entire data set, you should only rerequest those resources that have changed. This can be determined by watching our [[Special:RecentChanges|recent changes feed]] using [[mw:Special:MyLanguage/API:Recentchanges|<code>list=recentchanges</code>]].
+
Certain tasks done via the API, such as automatically building and maintaining a card database, may require information to be updated more often than every 30 days. In these cases, instead of simply rerequesting the entire data set, you should only rerequest those resources that have changed. This can be determined by watching our [[Special:RecentChanges|recent changes feed]] using <code>[[mw:Special:MyLanguage/API:Recentchanges|list=recentchanges]]</code>.
  
 
== Other points ==
 
== Other points ==
In addition to these, you should assume that the points on the [[mw:Special:MyLanguage/API:Etiquette|API etiquette]] page on MediaWiki.org also apply to use of the Yugipedia API; that page also has some advice on how to reduce the potential impact of requests. If you have questions or need help, you can join our [[Yugipedia:Discord|Discord server]].
+
In addition to these, you should assume that the points on the [[mw:Special:MyLanguage/API:Etiquette|API etiquette]] page on MediaWiki.org also apply to use of the Yugipedia API; that page also has some advice on how to reduce the potential impact of requests. If you have questions, need help, or want to provide feedback, you can join our [[Yugipedia:Discord|Discord server]].
  
 
== What do I do if I've been blocked? ==
 
== What do I do if I've been blocked? ==
 
If you've been blocked because of misuse of our API, the first step is to join our [[Yugipedia:Discord|Discord server]] and explain what you were doing with the API. It is very likely that your requests can be changed to meet our usage guidelines here, and we'd be happy to work with anyone who needs help on the matter.
 
If you've been blocked because of misuse of our API, the first step is to join our [[Yugipedia:Discord|Discord server]] and explain what you were doing with the API. It is very likely that your requests can be changed to meet our usage guidelines here, and we'd be happy to work with anyone who needs help on the matter.

Latest revision as of 00:46, 11 November 2019

Yugipedia uses MediaWiki, which offers a powerful API for automated access to our data. This API can be accessed via https://yugipedia.com/api.php, and extensive documentation can be found on MediaWiki.org. When using our API, please observe some points of etiquette, to avoid endangering the site; offending agents may be blocked without warning.

User agent[edit]

All automated requests to the API should set a descriptive User-Agent header, including the name of the service and contact information. Requesters who do not do so may be blocked at any time without warning.

Request limit[edit]

Please limit requests to no more than one per second. The content of multiple pages can be bundled together into a single request with a pipe (|), e.g. titles=PageA|PageB|PageC.

Caching[edit]

Results of requests should be cached wherever possible, and the cache should be used instead of rerequesting the same resources. A good period for caching is 30 days.

Updating data[edit]

Certain tasks done via the API, such as automatically building and maintaining a card database, may require information to be updated more often than every 30 days. In these cases, instead of simply rerequesting the entire data set, you should only rerequest those resources that have changed. This can be determined by watching our recent changes feed using list=recentchanges.

Other points[edit]

In addition to these, you should assume that the points on the API etiquette page on MediaWiki.org also apply to use of the Yugipedia API; that page also has some advice on how to reduce the potential impact of requests. If you have questions, need help, or want to provide feedback, you can join our Discord server.

What do I do if I've been blocked?[edit]

If you've been blocked because of misuse of our API, the first step is to join our Discord server and explain what you were doing with the API. It is very likely that your requests can be changed to meet our usage guidelines here, and we'd be happy to work with anyone who needs help on the matter.