forked from heroku/node-js-sample
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapi.html
725 lines (709 loc) · 19.7 KB
/
api.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>MathSight API Information Page
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css"
rel="stylesheet">
<link href="assets/css/screen-e9af46078c.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="masthead">
<h3 class="muted">
<a href="/">
MathSight
</a>
</h3>
<!-- /.navbar -->
</div>
<!-- Jumbotron -->
<div class="well">
<h3>
MathSight API
</h3>
<p>
Information for developers
</p>
</div>
<div class="row-fluid">
<div class="span4">
<h2>
Using our API
</h2>
<p>
This API makes it possible for you to use our analytics data within your
dashboard.
</p>
<div>
We are working with marketing agencies, toolbox providers and small to
medium-sized enterprises to create an extremely insightful set of metrics.
<div>
You are not allowed to white-label our data without our specific agreement.
If you plan to show our data input to a third party- please don't do so
without a prior discussion of the usage rules with us.
</div>
</div>
<p>
</p>
<p>
</p>
</div>
<div class="span4">
<h2>
API Cost
</h2>
<p>
The cost per URL request is 0.01 MathSight API credits. To purchase credits please contact [INSERT ADDRESS]@mathsight.org.
</p>
<p>
</p>
</div>
<div class="span4">
<h2>
Need more?
</h2>
<p>
If you require a different dataset or type to that specified below, or
want to send query for a very large list of urls then please do contact
us at [email protected].
</p>
<p>
</p>
</div>
</div>
<hr>
<div class="well">
<h3>
How do I get started?
</h3>
<p>
Contact us at [INSERT ADDRESS]@mathsight.org to register your chosen domains, get
your MathSight key and top up with API credits.
</p>
</div>
<div class="well">
<h3>
Keep up-to-date with changes
</h3>
<hr>
<p>
Here we will announce any new versions of our API. Released versions are 'final' and will not change.
Any new version will have accompanying release notes, and as a customer you decide whether to move to the new version.
</p>
</div>
<div class="well">
<h3>
Parameters used in our API function
</h3>
<hr>
<p>
1.
<b>target</b>
= this will be a target domain or page that you require the analytics
data for. There are two general types:
</p>
<div>
(a)
<i>onsite</i>
: main domain url of your chosen site (e.g. http://www.mydomain.com).
<br>
<div>
(b)
<i>offsite</i>
: domain url of an external page, or backlink, that references to your
chosen site (e.g. http://www.blogcatalog.com/).
<br>
<div>
<br>
<hr>
</div>
</div>
</div>
<p>
</p>
<div>
2.
<b>client_target</b>
= the specific URL you wish to target, in the case of offsite (it is unlikely
that you will want to analyse the whole offsite domain, and we will not
be storing the whole domain's data in any case).
<div>
This can be one or more of:
<div>
(a) In the case of target =onsite (from 1.), leave this blank
<div>
(b) In the case of target =offsite (from 1.), insert the client site URL
here
<div>
(no default value)
</div>
</div>
</div>
</div>
</div>
<hr>
<div>
3.
<b>offset</b>
= the starting position for the purposes of pagination of the response.
<div>
This can be any value from 0 to 'count', i.e. the number of possible items
in the response.
<div>
<div>
<div>
(default value = 0)
<br>
<div>
<br>
<hr>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
4.
<b>count</b>
= the number of entries requested for the purposes of pagination of the
response.
<div>
This can be any value from 0 to 10000.
<div>
<div>
<div>
(default value = 100)
<br>
<div>
<br>
<hr>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
5.
<b>mode</b>
= whether you are requesting a response for all (domain) pages or just
for single page.
<div>
Possible values: 'domain', 'single'. This parameter is applicable only
for onsite.
<div>
<div>
<div>
(default value = 'domain')
<br>
<div>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
<hr>
<div>
6.
<b>metric</b>
= the type of metric you require in the response.
<div>
Available for onsite domains and specific offiste URLs associated with
a single onsite domain.
<br>
<div>
Possible values:
<div>
<div>
</div>
</div>
</div>
</div>
</div>
<table class="table">
<tbody>
<tr>
<td>
Basic structural and content-based feature data gathered directly from
this domain's html pages, analagous to an site auditor output.
</td>
<td>
<b></b>
StatSEO traffic quotient metric based on amalgamated page feature data
and Google search 'pageview' data by URL over the last 1, 3, 6, and 12
months.
<br>
In addition to the StatSEO figure this includes:
<br>
'cluster': the cluster or page type this URL has automatically been assigned
as.
<br>
'health': the health rating of this page according to the StatSEO quotient
(SQ) for this cluster type.
</td>
<td>
Highlighted significant features listed with:
<br>
(i) a ranking according to their influence upon the statseo figure.
<br>
(ii) a count of healthy and harmful pages,
<br>
and (iii) the average SQ for each group.
</td>
<td>
Allows you to see which URLs are potentially harmful to your chosen domain.
<br>
As part of drilldown we will provide the relevant feature value, a winning
mean to aim for and the difference (delta) to the improved value.
</td>
</tr>
</tbody>
<thead>
<tr>
<th>
feature
</th>
<th>
statseo
</th>
<th>
highlight
</th>
<th>
drilldown
</th>
</tr>
</thead>
</table>
<div>
<div>
(metric has no default value)
<br>
<div>
<br>
</div>
</div>
7.
<b>format</b>
= defines the desired format of the response.
<div>
Possible values: 'json', 'xml', 'csv'.
<div>
For now, our API supports only
<a href="http://json.org">JSON</a>
. Please send us an email to [email protected] should you require other
formats.
<div>
(default value = 'json')
</div>
<div>
<br>
</div>
</div>
</div>
</div>
<p>
</p>
<table class="table">
<tbody>
<tr>
</tr>
</tbody>
</table>
<div>
8.
<b>filter</b>
= If filter is absent for a query, then ALL metrics are returned.
<div>
Filter is space delimited parameter with appropriate parameters:
<div>
<br>
<div>
<div>
</div>
</div>
</div>
</div>
</div>
<table class="table">
<tbody>
<tr>
<td>
feature
</td>
<td>
feature names, e.g. : "number_of_rare_words"
</td>
</tr>
<tr>
<td>
highlight
</td>
<td>
(none)
</td>
</tr>
<tr>
<td>
statseo
</td>
<td>
(none)
</td>
</tr>
<tr>
<td>
drilldown
</td>
<td>
(none)
</td>
</tr>
</tbody>
<thead>
<tr>
<th>
Metric
</th>
<th>
filter values
</th>
</tr>
</thead>
</table>
<div>
9.
<b>order</b>
<div>
This is valid only for metric=highlight, otherwise the parameter is ignored.
Sorting is made based on the influence rank (i.e. the first number in the
row).
<div>
For metric=highlight response, 4 numbers in each row are expected, where
influence rank is always first one:
<div>
Possible values: 'asc', 'desc'.
<div>
<br>
</div>
</div>
</div>
</div>
</div>
<div>
10.
<b>type</b>
<div>
This is valid only for 'count', otherwise the parameter is ignored.
<div>
<div>
Possible values: 'onsite', 'offsite', 'fullsite'. The last of these three
will respond with both onsite and offsite values.
<div>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="well">
<h3>
Our API enables you to get the following:
</h3>
<hr>
<p>
<a href="#htmlFeatDef">
1. Count of potentially healthy/neutral/harmful URLs</a> - A high level summary of the onsite and offsite health status of your chosen domain. This is based upon our StatSEO Quotient figure - a measure of attractiveness to Google's search algorithm
</p>
<p>
</p>
<div>
<a href="#statSeoDef"><br> <br>
2. A breakdown by the most influential features </a> - this shows you exactly what is affecting the bottom line; your domain's organic search performance.
<div>
</div>
</div>
<div>
<a href="#highlightsDef"><br> <br>
3. A list of the most potentially harmful URLs </a> - according to the assessment of page feature values.
<div> </div>
</div>
</div>
<div class="well">
<h3 id="htmlFeatDef">
1. Count of potentially healthy/neutral/harmful URLs
</h3>
<p>
<!--
Per request cost: £X.XX, with Google Analytics access for this domain
£X.XX
-->
</p>
<table class="table">
<tbody>
<tr>
<td>
ONSITE:
</td>
<td>
<pre><code>https://api.mathsight.org/ms_api/v1/count?target=http%3A%2F%2Fwww.mydomain.com&type=onsite&token={
Your MathSight key }</code></pre>
</td>
</tr>
<tr>
<td>
OFFSITE:
</td>
<td>
<pre><code>https://api.mathsight.org/ms_api/v1/count?target=http%3A%2F%2Fwww.mydomain.com&type=offsite&token={
Your MathSight key }</code></pre>
</td>
</tr>
<tr>
<td>
FULLSITE:
</td>
<td>
<pre><code>https://api.mathsight.org/ms_api/v1/count?target=http%3A%2F%2Fwww.mydomain.com&type=fullsite&token={
Your MathSight key }</code></pre>
</td>
</tr>
</tbody>
<thead>
<tr>
<th>
Type
</th>
<th>
Query example
</th>
</tr>
</thead>
</table>
<div>
<div>
Response example:
</div>
<pre><code>
{
"onsite" :
{
"count" : 553,
"healthy" : 53,
"neutral" : 249,
"harmful" : 251
},
"offsite" :
{
"count" : 10,
"healthy" : 3,
"neutral" : 0,
"harmful" : 7
}
}
</code></pre>
<br>
</div>
</div>
<div class="well">
<h3 id="statSeoDef">
2. Breakdown of diagnosis by influential feature
</h3>
<!--
<p>
Per request cost: £X.XX, with Google Analytics access for this domain
£X.XX
</p>
-->
<p>
Query example:
</p>
<table class="table">
<tbody>
<tr>
<td>
ONSITE:
</td>
<td>
<pre><code>https://api.mathsight.org/ms_api/v1/onsite?target=http%3A%2F%2Fwww.mydomain.com&metric=highlight&token={
Your MathSight key }</code></pre>
</td>
</tr>
<tr>
<td>
OFFSITE:
</td>
<td>
<pre><code>https://api.mathsight.org/ms_api/v1/offsite?target=http%3A%2F%2Fwww.blogpage.com&metric=highlight&token={
Your MathSight key }</code></pre>
</td>
</tr>
</tbody>
<thead>
<tr>
<th>
Type
</th>
<th>
Query example
</th>
</tr>
</thead>
</table>
<p>
Response example:
</p>
<pre><code>
{
"result": [
{
"average_backlink_flesch_reading_ease": [1,553,-0.24,0,0],
"number_of_images_missing_alt": [2,553,-0.24,0,0],
"number_of_embedded_javascripts": [3,254,-0.11,299,-0.13],
"title_number_of_dictionary_words": [4,299,-0.13,254,-0.11],
"number_of_images": [5,531,-0.21,22,-0.03],
"number_of_scripts": [6,0,0,553,-0.24],
"ratio_of_common_words_to_total": [7,211,-0.1,342,-0.14],
"number_of_inline_css_styles": [8,542,-0.24,11,-0],
"number_of_images_in_body": [9,523,-0.21,30,-0.03],
"html5_detected": [10,0,0,553,-0.24]
...
}
]
}
</code></pre>
<br>
</div>
<div class="well">
<h3 id="highlightsDef">
3. Drilldown: Which URLs are 'harmful' to your domain?
</h3>
<!--
<p>
Per request cost: £X.XX, with Google Analytics access for this domain
£X.XX
</p>
-->
<div>
<table class="table">
<tbody>
<tr>
<td>
ONSITE:
</td>
<td>
<pre><code>https://api.mathsight.org/ms_api/v1/onsite?target=http%3A%2F%2Fwww.mydomain.com&metric=drilldown&token={
Your MathSight key }</code></pre>
</td>
</tr>
<tr>
<td>
OFFSITE:
</td>
<td>
<pre><code>https://api.mathsight.org/ms_api/v1/offsite?target=http%3A%2F%2Fwww.blogpage.com&metric=drilldown&token={
Your MathSight key }</code></pre>
</td>
</tr>
</tbody>
<thead>
<tr>
<th>
Type
</th>
<th>
Query example
</th>
</tr>
</thead>
</table>
Response example:
<div>
<pre><code>
{
"result":
{
"average_backlink_flesch_reading_ease":
[
{
"html_id": "http://www.mydomain.com/terms-and-conditions",
"feature_value": 1,
"delta": 41.615687
},
{
"html_id": "http://www.mydomain.com/2012/12/13/jewellery-trends-spring-summer-2013",
"feature_value": 2,
"delta": 42.615687
},
{
"html_id": "http://www.mydomain.com/terms-and-conditions",
"feature_value": 3,
"delta": 43.615687
}
],
"number_of_images_missing_alt":
[
{
"html_id": "http://www.mydomain.com/terms-and-conditions",
"feature_value": 1,
"delta": 41.615687
},
{
"html_id": "http://www.mydomain.com/2012/12/13/jewellery-trends-spring-summer-2013",
"feature_value": 2,
"delta": 42.615687
},
{
"html_id": "http://www.mydomain.com/terms-and-conditions",
"feature_value": 3,
"delta": 43.615687
}
]
...
}
}
</code></pre>
<br>
</div>
</div>
<p>
</p>
<p>
</p>
<div>
<br>
</div>
<p>
</p>
</div>
<div class="jumbotron">
</div>
<!-- Example row of columns -->
<hr>
<div class="footer">
<p>
© MathSight 2013
</p>
</div>
</div>
<!-- /container -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"
>
</script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"
>
</script>
</body>
</html>