diff --git a/static/api.css b/static/api.css index 98da9a3..ff7dfcd 100644 --- a/static/api.css +++ b/static/api.css @@ -13,10 +13,12 @@ span.code { span.param-key { color: #009; + font-weight: bold; } span.param-val { color: #900; + font-weight: bold; } table.parameters { @@ -52,3 +54,8 @@ a:link { color: #373; text-decoration: none; } a:visited { color: #373; text-decoration: none; } a:hover { color: #040; text-decoration: underline; } a:active { color: #404; text-decoration: underline; } + +a.no-color:link { color: #000; text-decoration: none; } +a.no-color:visited { color: #000; text-decoration: none; } +a.no-color:hover { color: #000; text-decoration: underline; } +a.no-color:active { color: #000; text-decoration: underline; } diff --git a/templates/api.mako b/templates/api.mako index 41b08f8..f3b2137 100644 --- a/templates/api.mako +++ b/templates/api.mako @@ -153,7 +153,7 @@

Responses

The JSON response object always contains a status key, whose value is either ok or error. If an error has occurred, the response will look like this:

-
{
+                
{
     "status": "error",
     "error": {
         "code": (string) error code,
@@ -161,7 +161,7 @@
     }
 }

Valid responses for action=compare and action=search are formatted like this:

-
{
+                
{
     "status": "ok",
     "meta": {
         "time":       (float) time to generate results, in seconds,
@@ -196,7 +196,7 @@
                 

In the case of action=search, sources will contain one entry for each source checked (or skipped if the check ends early), sorted in order of confidence, with skipped sources at the bottom.

In the case of action=compare, best will always contain information about the URL that was given, so response["best"]["url"] will never be null. Also, sources will always contain one entry, with the same data as best, since only one source is checked in comparison mode.

Valid responses for action=sites are formatted like this:

-
{
+                
{
     "status": "ok",
     "langs": [
         [
@@ -213,10 +213,14 @@
         ...
     ]
 }
+

Caveats

+
    +
  • There is currently no way to get the contents of the article or suspected source, nor can you get the data behind the visual comparison available from the main tool. This may be changed in a future version if there is sufficient demand for it.
  • +
  • Requests are typically not rate-limited, but the tool uses the same workers to handle all requests, so making simultaneous API calls is only going to slow you down. In general, you are fine making an unlimited number of requests, as long as they are not concurrent and you wait a few seconds between them.
  • +

Example

-

https://tools.wmflabs.org/copyvios/api.json?version=1&action=search&project=wikipedia&lang=en&title=User:The_Earwig/Sandbox/CopyvioExample

-
-{
+                

https://tools.wmflabs.org/copyvios/api.json?version=1&action=search&project=wikipedia&lang=en&title=User:The_Earwig/Sandbox/CopyvioExample

+
{
     "status": "ok",
     "meta": {
         "time": 2.2474379539489746,