Wikipedia:Wiki ViewStats/API
Zur Navigation springen
Zur Suche springen
URL Parameters
[Quelltext bearbeiten]base url: https://tools.wmflabs.org/wikiviewstats/index.php
parameter | impact | possible values | short example(s) | default | version |
---|---|---|---|---|---|
page | page title |
|
|
-none- | 0.92 |
lang | wiki language |
|
|
your browsers default language | 0.92 |
project or wiki |
wiki |
|
|
wikipedia | 0.92 / 0.99 (alternative parameter name + values) |
latest 1 | query period in past days |
|
|
30 | 0.92 |
datefrom 1 | query start date |
|
|
automatically calculated | 0.1 |
dateto 1 | query end date |
|
|
automatically calculated | 0.1 |
type 2 | TOP-lists, HOT today |
|
|
-none- | 0.1 / thanks 0.98 |
locale 3 | GUI language |
|
|
your browsers default language | 0.1 |
favurl 4 | URL of wiki page where your favorites are located |
|
|
-none- | 0.95 |
section 5 | Page section where favorites are located |
|
|
-none- | 0.95 |
(1)
You can either specify latest OR datefrom (dedicated month) OR datefrom + dateto (custom). If you specify all of them - Uhm, you will see what you get.
(2)
In combination with datefrom≔0000-00-00 (today) OR datefrom≔2013-xx-00 (dedicated month). If datefrom is omitted datefrom≔0000-00-00 (today) is set automatically
(3)
Your preferred language not yet there? Feel free to act! Leave a message.
(5)
Only in combination with parameter favurl
Examples
[Quelltext bearbeiten]Query string and parameters follow the rules of RFC 1738 and RFC 3986. The first parameter ist attached to base url with "?" sign, further parameters are attached with "&" sign.
base url: https://tools.wmflabs.org/wikiviewstats/index.php
base url + query string | result |
---|---|
https://tools.wmflabs.org/wikiviewstats/index.php?page=Star_Trek | hits of page title "Star Trek" (30 days) |
https://tools.wmflabs.org/wikiviewstats/index.php?page=Avatar_(película)&lang=es | hits of "Avatar (film)" in spanisch wikipedia (30 days) |
https://tools.wmflabs.org/wikiviewstats/index.php?page=word&lang=ru&project=d | hits of "word" in russian wiktionary (30 days) |
https://tools.wmflabs.org/wikiviewstats/index.php?type=world&lang=zh&project=% | top list of all pages in all chinese (zh) wikis (today) |
↓ for subsequent examples baseurl is not shown (you can click the link anyway) | |
?favurl=https://de.wikipedia.org/wiki/Benutzer:Hedonil§ion=Agenda | hits of user hedonil's articles (30 days) |
RESTful syntax & internal links
[Quelltext bearbeiten]Alternatively it's possible to make an invocation using RESTful URI syntax – also known as "clean" URI-syntax[1]
As of version 0.99 there are 2 alternatives:
type | RESTful URI syntax | internal wiki link |
---|---|---|
1. full | https://tools.wmflabs.org/wikiviewstats/lang.wiki/latest/page | [[toollabs:wikiviewstats/de/latest30/Theodor_Fontane]] alternatively [[toollabs:wikiviewstats/de/30/Theodor_Fontane]] |
2. short | https://tools.wmflabs.org/wikiviewstats/lang.wiki/page | [[toollabs:wikiviewstats/de.q/Theodor_Fontane]] alternatively [[toollabs:wikiviewstats/de.wikiquote/Theodor_Fontane]] |
- If a parameter is not specified, default values are set
- With this syntax only "*" as wildcard is allowed. "%" is forbidden by specification.
References
[Quelltext bearbeiten]- ↑ RESTful uri design at blog.2partsmagic.com