Wikipedia Pageviews
Freeknowledge:wikipedia-pageviews
Daily views of a Wikipedia article and the most read articles, to see how much public attention a topic gets.
No key yet? Sign up free
GET/v1/knowledge:wikipedia-pageviews/article
Daily views of one article.
Cache 21600 s
1 quota / request
knowledge.wikipedia-pageviews.article
cURL
curl -H "x-api-key: ga_live_..." "https://kajidata.artonlabs.com/v1/knowledge:wikipedia-pageviews/article?days=14&article=Inflasi"
Python
import requests
response = requests.get(
"https://kajidata.artonlabs.com/v1/knowledge:wikipedia-pageviews/article",
params={"days": "14", "article": "Inflasi"},
headers={"x-api-key": "ga_live_..."},
timeout=30,
)
body = response.json()
print(body["data"] if body["ok"] else body["error"])
JavaScript
const params = new URLSearchParams({"days": "14", "article": "Inflasi"});
const response = await fetch(`https://kajidata.artonlabs.com/v1/knowledge:wikipedia-pageviews/article?${params}`, {
headers: { "x-api-key": "ga_live_..." },
});
const body = await response.json();
console.log(body.ok ? body.data : body.error);
PHP
<?php
$ch = curl_init('https://kajidata.artonlabs.com/v1/knowledge:wikipedia-pageviews/article?' . http_build_query(['days' => '14', 'article' => 'Inflasi']));
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['x-api-key: ga_live_...'],
CURLOPT_TIMEOUT => 30,
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($body['ok'] ? $body['data'] : $body['error']);
Go
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
)
func main() {
params := url.Values{}
params.Set("days", "14")
params.Set("article", "Inflasi")
req, _ := http.NewRequest("GET", "https://kajidata.artonlabs.com/v1/knowledge:wikipedia-pageviews/article?"+params.Encode(), nil)
req.Header.Set("x-api-key", "ga_live_...")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
var body map[string]any
json.NewDecoder(res.Body).Decode(&body)
fmt.Println(body["data"])
}
Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder(URI.create("https://kajidata.artonlabs.com/v1/knowledge:wikipedia-pageviews/article?days=14&article=Inflasi"))
.header("x-api-key", "ga_live_...")
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
Ruby
require "net/http"
require "json"
uri = URI("https://kajidata.artonlabs.com/v1/knowledge:wikipedia-pageviews/article")
uri.query = URI.encode_www_form({"days" => "14", "article" => "Inflasi"})
request = Net::HTTP::Get.new(uri)
request["x-api-key"] = "ga_live_..."
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
body = JSON.parse(response.body)
puts body["ok"] ? body["data"] : body["error"]
C#
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "ga_live_...");
var json = await client.GetStringAsync("https://kajidata.artonlabs.com/v1/knowledge:wikipedia-pageviews/article?days=14&article=Inflasi");
Console.WriteLine(json);
GET/v1/knowledge:wikipedia-pageviews/top
Most read articles on one day, to see what the public is looking up.
Cache 21600 s
1 quota / request
knowledge.wikipedia-pageviews.top
cURL
curl -H "x-api-key: ga_live_..." "https://kajidata.artonlabs.com/v1/knowledge:wikipedia-pageviews/top?lang=id&limit=10"
Python
import requests
response = requests.get(
"https://kajidata.artonlabs.com/v1/knowledge:wikipedia-pageviews/top",
params={"lang": "id", "limit": "10"},
headers={"x-api-key": "ga_live_..."},
timeout=30,
)
body = response.json()
print(body["data"] if body["ok"] else body["error"])
JavaScript
const params = new URLSearchParams({"lang": "id", "limit": "10"});
const response = await fetch(`https://kajidata.artonlabs.com/v1/knowledge:wikipedia-pageviews/top?${params}`, {
headers: { "x-api-key": "ga_live_..." },
});
const body = await response.json();
console.log(body.ok ? body.data : body.error);
PHP
<?php
$ch = curl_init('https://kajidata.artonlabs.com/v1/knowledge:wikipedia-pageviews/top?' . http_build_query(['lang' => 'id', 'limit' => '10']));
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['x-api-key: ga_live_...'],
CURLOPT_TIMEOUT => 30,
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($body['ok'] ? $body['data'] : $body['error']);
Go
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
)
func main() {
params := url.Values{}
params.Set("lang", "id")
params.Set("limit", "10")
req, _ := http.NewRequest("GET", "https://kajidata.artonlabs.com/v1/knowledge:wikipedia-pageviews/top?"+params.Encode(), nil)
req.Header.Set("x-api-key", "ga_live_...")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
var body map[string]any
json.NewDecoder(res.Body).Decode(&body)
fmt.Println(body["data"])
}
Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder(URI.create("https://kajidata.artonlabs.com/v1/knowledge:wikipedia-pageviews/top?lang=id&limit=10"))
.header("x-api-key", "ga_live_...")
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
Ruby
require "net/http"
require "json"
uri = URI("https://kajidata.artonlabs.com/v1/knowledge:wikipedia-pageviews/top")
uri.query = URI.encode_www_form({"lang" => "id", "limit" => "10"})
request = Net::HTTP::Get.new(uri)
request["x-api-key"] = "ga_live_..."
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
body = JSON.parse(response.body)
puts body["ok"] ? body["data"] : body["error"]
C#
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "ga_live_...");
var json = await client.GetStringAsync("https://kajidata.artonlabs.com/v1/knowledge:wikipedia-pageviews/top?lang=id&limit=10");
Console.WriteLine(json);