Legitimate API
Version 1.0

Getting set up

To be able to make API calls you need to have a Legitimate profile. After creating a legitimate profile go to https://dev.legitimate.io/apis.html where you can sign up for an API account.
Once you sign up for an account your API credentials will be available in your settings area under "API Settings.
API credentials

Authentication

To authenticate your call you need to use a Bearer Token made up from your API key and secret.
1
Uivayfc1Tvk2SED6rEohPvGt:8XCjPrzqCZ11r554JPWDn26g
Copied!

post
https://www.legitimate.io/api
/verify_article
Verify Article

Example call

1
https://dev.legitimate.io/api/verify_article?url=https://syncni.com/view/4879/are-tech-giants-do-enough-to-combat-fake-news
Copied!

Example Response

1
{
2
"verified": true,
3
"profile_first_name": "Niamh",
4
"profile_last_name": "Campbell",
5
"profile_title": "Journalist",
6
"profile_created_at": "2020-04-19T13:36:38.878Z",
7
"profile_bio": "Journalist with online & print magazine Sync NI, reporting on all things business and technology in Northern Ireland. I often freelance with BBC News and BBC Sport NI, and have contributed to BBC Radio Ulster. I have a regular slot with local Belfast radio station, Blast 106 FM every Sunday evening.",
8
"profile_employer": "Sync NI ",
9
"profile_residing": "Belfast",
10
"profile_slug": "niamh-campbell",
11
"profile_image": "https://dev.legitimate.io/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBEdz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--00597287f0a920041807e62056af2c8be8a1f540/QN_8Hk7m_400x400.jpg",
12
"profile_social_profiles": {
13
"twitter": "@niamhcam94",
14
"facebook": "niamhcam94",
15
"linkedin": "niamh-campbell-374a52139",
16
"instagram": "ncampboxblog"
17
},
18
"user_location": "IRL",
19
"user_city": "Belfast",
20
"follower_count": 2,
21
"article_count": 25,
22
"articles": [
23
{
24
"id": 9558,
25
"title": "Are tech giants doing enough to combat fake news? ",
26
"description": "2020 has seen not only a global health pandemic, but a global epidemic of fakes news. Now, the tech giants are trying to combat this, but should it have been tackled long before the present?Whatsapp\r\nSince August, WhatsApp has been piloting a new feature ...",
27
"link": "https://syncni.com/view/4879/are-tech-giants-doing-enough-to-combat-fake-news",
28
"profile_id": 18,
29
"created_at": "2020-09-30T10:24:50.074Z",
30
"updated_at": "2020-09-30T10:24:50.074Z",
31
"og_image": "https://d3ku2up3znex6l.cloudfront.net/public/sitereview_listing/41/53/01/150ef_0fbf.jpeg?c=bb3d",
32
"icon_path": "https://syncni.com//favicon.ico?c=1433",
33
"published_at": "2020-09-30T10:24:50.072Z",
34
"post_id": null,
35
"feature": false,
36
"lg_index": null,
37
"tag_list": [
38
"Tech",
39
"Fake News",
40
"social media",
41
"Opinion"
42
]
43
},
44
{
45
"id": 1997,
46
"title": "How is AI helping throughout the Covid-19 pandemic?",
47
"description": "Back in February 2020, a World Health Organisation report noted that artificial intelligence and big data were a key part of China’s response to the coronavirus outbreak. It has been almost six months since the UK and Ireland went into lockdown due...",
48
"link": "https://syncni.com/article/4614/how-is-ai-helping-throughout-the-covid-19-pandemic",
49
"profile_id": 18,
50
"created_at": "2020-08-07T12:08:53.016Z",
51
"updated_at": "2020-09-21T23:39:05.246Z",
52
"og_image": "https://d3ku2up3znex6l.cloudfront.net/public/sitereview_listing/b5/4d/01/14b69_ce44.jpeg?c=341d",
53
"icon_path": "https://syncni.com//favicon.ico?c=1433",
54
"published_at": "2020-08-07T12:08:53.016Z",
55
"post_id": null,
56
"feature": false,
57
"lg_index": null,
58
"tag_list": [
59
"AI",
60
"Tech",
61
"Covid",
62
"Artificial Intelligence"
63
]
64
},
65
{
66
"id": 1996,
67
"title": "Data shows lockdown deprivation causes domino distress on NI's children",
68
"description": "Back in early April, in the premature stages of lockdown, BBC Newsnight’s Emily Maitlis opened the programme announcing, “They tell us coronavirus is a great leveller. It’s not. It’s much, much harder if you’re poor.” ...",
69
"link": "https://syncni.com/article/4586/data-shows-lockdown-deprivation-causes-domino-distress-on-ni-s-children",
70
"profile_id": 18,
71
"created_at": "2020-08-07T12:06:02.441Z",
72
"updated_at": "2020-09-21T23:39:05.190Z",
73
"og_image": "https://d3ku2up3znex6l.cloudfront.net/public/sitereview_listing/e9/4c/01/14a9e_f734.jpg?c=a23b",
74
"icon_path": "https://syncni.com//favicon.ico?c=1433",
75
"published_at": "2020-08-07T12:06:02.441Z",
76
"post_id": null,
77
"feature": false,
78
"lg_index": null,
79
"tag_list": [
80
"data",
81
"Children",
82
"Covid",
83
"northern ireland"
84
]
85
}
86
]
87
}
Copied!

Examples in various languages

Curl
Javascript
PHP
Python - http.client
Ruby
Java - OKHttp
1
curl --location --request POST 'https://dev.legitimate.io/api/verify_article?url=https://syncni.com/view/4879/are-tech-giants-doing-enough-to-combat-fake-news' \
2
--header 'Authorization: Bearer Ak8fkrk9jf98kjr889:9XdkfkK9H7yy7g76ggTX'
Copied!
1
var myHeaders = new Headers();
2
myHeaders.append("Authorization", "Bearer Ak8fkrk9jf98kjr889:9XdkfkK9H7yy7g76ggTX");
3
4
var formdata = new FormData();
5
6
var requestOptions = {
7
method: 'POST',
8
headers: myHeaders,
9
body: formdata,
10
redirect: 'follow'
11
};
12
13
fetch("https://dev.legitimate.io/api/verify_article?url=https://syncni.com/view/4879/are-tech-giants-doing-enough-to-combat-fake-news", requestOptions)
14
.then(response => response.text())
15
.then(result => console.log(result))
16
.catch(error => console.log('error', error));
Copied!
1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://dev.legitimate.io/api/verify_article?url=https://syncni.com/view/4879/are-tech-giants-doing-enough-to-combat-fake-news',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'POST',
14
CURLOPT_HTTPHEADER => array(
15
'Authorization: Bearer Ak8fkrk9jf98kjr889:9XdkfkK9H7yy7g76ggTX'
16
),
17
));
18
19
$response = curl_exec($curl);
20
21
curl_close($curl);
22
echo $response;
Copied!
1
import http.client
2
import mimetypes
3
from codecs import encode
4
5
conn = http.client.HTTPSConnection("dev.legitimate.io")
6
boundary = ''
7
payload = ''
8
headers = {
9
'Authorization': 'Bearer Ak8fkrk9jf98kjr889:9XdkfkK9H7yy7g76ggTX',
10
'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
11
}
12
conn.request("POST", "/api/verify_article?url=https://syncni.com/view/4879/are-tech-giants-doing-enough-to-combat-fake-news", payload, headers)
13
res = conn.getresponse()
14
data = res.read()
15
print(data.decode("utf-8"))
Copied!
1
require "uri"
2
require "net/http"
3
4
url = URI("https://dev.legitimate.io/api/verify_article?url=https://syncni.com/view/4879/are-tech-giants-doing-enough-to-combat-fake-news")
5
6
https = Net::HTTP.new(url.host, url.port)
7
https.use_ssl = true
8
9
request = Net::HTTP::Post.new(url)
10
request["Authorization"] = "Bearer Ak8fkrk9jf98kjr889:9XdkfkK9H7yy7g76ggTX"
11
form_data = []
12
request.set_form form_data, 'multipart/form-data'
13
response = https.request(request)
14
puts response.read_body
Copied!
1
OkHttpClient client = new OkHttpClient().newBuilder()
2
.build();
3
MediaType mediaType = MediaType.parse("text/plain");
4
MediaType JSON = MediaType.parse("application/json; charset=utf-8");
5
RequestBody body = RequestBody.create(JSON, "{}");
6
Request request = new Request.Builder()
7
.url("https://dev.legitimate.io/api/verify_article?url=https://syncni.com/view/4879/are-tech-giants-doing-enough-to-combat-fake-news")
8
.method("POST", body)
9
.addHeader("Authorization", "Bearer Ak8fkrk9jf98kjr889:9XdkfkK9H7yy7g76ggTX")
10
.build();
11
Response response = client.newCall(request).execute();
Copied!
Last modified 2mo ago