LizardBot/ API

From LizardWiki, FastLizard4's wiki and website
Jump to: navigation, search

Ambox rewrite orange.svg

Note: Some experience in the PHP programming language - which this bot is written in - is recommended for using this bot. The documentation on this site assumes that you are familiar with at least the basics of PHP (such as declaring variables, how to quote strings, etc.). That said, this is only a recommendation - if you don't know PHP at all, you are welcome to try out LizardBot, and do ask for help on our IRC channel or elsewhere if you need it.

LizardBot now has the capability of interfacing with's API, allowing for convenient URL shortening, expansion, lookups, etc., all powered by This functionality was introduced in LizardBot (r69).

Command Documentation

First, it's worth noting that to access the command, certain variables must be configured:

  • $setEnableBitly: Boolean. Set this to TRUE to enable the API. Note that this is one of three settings required for the API to work, the others being$setBitlyLogin and $setBitlyAPIKey.
  • $setBitlyAPISleep: Integer. The number of seconds after a command that the bot forces one to wait so that you don't exceed your API limit. The default is rather high, 30.
  • $setBitlyLogin: String. Required for the API to run. This is your username (or API username, if applicable) of your account. You need one (which is free, by the way) to use the API functions of LizardBot. This is normally your login username. See their website to get an account.
  • $setBitlyAPIKey: String. Required for the API to run. This is your API key, which is generated for all users by You need one to use the API functions of LizardBot. If you have an account, you can find your API Key here. Otherwise, you'll need to create an account first, then get your API Key. This is not your login password.

In addition, one must have the privilege, normally assigned to the * group.

The system adds only one new command to the bot, However, this command has multiple "actions" (the single argument to each is in italics):

  • shorten Long URL to shorten into a URL
  • expand URL to expand into a long URL
  • clicks URL to get click stats for
  • checkpro domain to check whether or not it's a pro domain
  • lookup Long URL to check to see if it's already been shortened at, and to return that shortened URL, if it exists
  • info URL to get information for - specifically, the target page's title at the URL's creator

The above list should be self-explanatory.

API Rate Limiting enforces API rate limits. Specifically, one IP address may only make five concurrent API requests, and each IP only gets so many [the number isn't stated directly] API requests per hour (resetting at the top of every hour). To this end, the bot itself enforces a rate limit as configured by the $setBitlyAPISleep setting (see above).


WARNING: Unless you have an application API key, LizardBot will use your personal account's API key (however you configure it). All links created using shorten will therefore appear as being created by you. You may want to take this into account when defining the access group for the privilege.

Further Reading

You can see's full API documentation here.