diff --git a/static/api.css b/static/api.css index ff7dfcd..7b064b5 100644 --- a/static/api.css +++ b/static/api.css @@ -2,6 +2,10 @@ h1, h2 { font-family: sans-serif; } +pre { + white-space: pre-wrap; +} + div#help { margin: auto; max-width: 1200px; @@ -11,6 +15,19 @@ span.code { font-family: monospace; } +span.resp-dtype, span.resp-desc { + padding: 0 0.25em; + background-color: #E5E5E5; +} + +span.resp-dtype { + color: #009; +} + +span.resp-desc { + color: #090; +} + span.param-key { color: #009; font-weight: bold; @@ -36,6 +53,8 @@ table.parameters th { table.parameters tr:first-child { font-family: sans-serif; font-size: 1.17em; + background-color: #369; + color: white; } table.parameters td:first-child { diff --git a/templates/api.mako b/templates/api.mako index f3b2137..7f974c5 100644 --- a/templates/api.mako +++ b/templates/api.mako @@ -156,39 +156,39 @@
{
     "status": "error",
     "error": {
-        "code": (string) error code,
-        "info": (string) human-readable description of error
+        "code": string error code,
+        "info": string human-readable description of error
     }
 }

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

{
     "status": "ok",
     "meta": {
-        "time":       (float) time to generate results, in seconds,
-        "queries":    (int) number of search engine queries made,
-        "cached":     (boolean) whether or not these results are cached from an earlier search (always false in the case of action=compare),
-        (only if cached=true) "cache_time": (string) human-readable time of the original search that the results are cached from
-        "redirected": (boolean) whether or not a redirect was followed
+        "time":       float time to generate results, in seconds,
+        "queries":    int number of search engine queries made,
+        "cached":     boolean whether or not these results are cached from an earlier search (always false in the case of action=compare),
+        (only if cached=true) "cache_time": string human-readable time of the original search that the results are cached from,
+        "redirected": boolean whether or not a redirect was followed
     },
     "page": {
-        "title": (string) the normalized title of the page checked,
-        "url":   (string) the full URL of the page checked
+        "title": string the normalized title of the page checked,
+        "url":   string the full URL of the page checked
     },
     (only if redirected=true) "original_page": {
-        "title": (string) the normalized title of the original page whose redirect was followed,
-        "url":   (string) the full URL of the original page whose redirect was followed
+        "title": string the normalized title of the original page whose redirect was followed,
+        "url":   string the full URL of the original page whose redirect was followed
     },
     "best": {
-        "url":        (string) the URL of the best match found, or null if no matches were found,
-        "confidence": (float) the confidence of a violation in the best match, or 0.0 if no matches were found,
-        "violation":  (string) one of "suspected", "possible", or "none"
+        "url":        string the URL of the best match found, or null if no matches were found,
+        "confidence": float the confidence of a violation in the best match, or 0.0 if no matches were found,
+        "violation":  string one of "suspected", "possible", or "none"
     },
     "sources": [
         {
-            "url":        (string) the URL of the source,
-            "confidence": (float) the confidence of a violation in the source,
-            "violation":  (string) one of "suspected", "possible", or "none",
-            "skipped":    (boolean) whether or not the source was skipped due to the check finishing early (see note about noskip above)
+            "url":        string the URL of the source,
+            "confidence": float the confidence of a violation in the source,
+            "violation":  string one of "suspected", "possible", or "none",
+            "skipped":    boolean whether or not the source was skipped due to the check finishing early (see note about noskip above)
         },
         ...
     ]
@@ -200,15 +200,15 @@
     "status": "ok",
     "langs": [
         [
-            (string) language code,
-            (string) human-readable language name
+            string language code,
+            string human-readable language name
         ],
         ...
     ],
     "projects": [
         [
-            (string) project code,
-            (string) human-readable project name
+            string project code,
+            string human-readable project name
         ],
         ...
     ]