Skip to content

Latest commit

 

History

History
82 lines (46 loc) · 2.67 KB

misc.md

File metadata and controls

82 lines (46 loc) · 2.67 KB

Miscellaneous

There are some small, yet useful APIs. You can familiarise yourself with AJAX caling by using these APIs.

Use api.ipify.org for IPv4 and api6.ipify.org for IPv6. There is a param called format with tree values avaiable:

  1. text returns a text file like 127.0.0.1.
  2. json returns a JSON file like {"ip":"127.0.0.1"}.
  3. jsonp returns a JavaScript file like callback({"ip":"127.0.0.1"});.
    1. Additionally, You can specify callback to decide the name of the callback function in your front end. FOr example, callback=cb returns cb({"ip":"127.0.0.1"});.

Use force to force the API returns yes, no, or maybe. Usually the API returns yes or no, but maybe appears every 1/10.000 time.

10,000 requests a month when using without x-api-key.

10,000 requests a month when using without x-api-key.

A playground is avaiable.

Is there an interface for automated systems to access comics and metadata? Yes. You can get comics through the JSON interface, at URLs like https://xkcd.com/info.0.json (current comic) and https://xkcd.com/614/info.0.json (comic #614). ~ From https://xkcd.com/about

/api/{number}/{type}/{length}

Generate random lorem ipsum text.

  • number: Number of paragraphs or words to generate (default: 1)
  • type: Type of content to generate, either paragraphs or words (default: paragraphs)
  • length: Length of each paragraph or word (default: long)

/api/random

Generate random lorem ipsum text.