Detailed look at API for beginners: What is API, how to use it and how to find the right API for you

09/07/2020

If you ever managed to find (or steal ( ͡° ͜ʖ ͡°) ) some command that generates images out of user input, whether it was from text or profile picture, you just wanted more. And i still do, too. It wasn't really easy to find new API at first, but once i got the hang out of it, i started finding new APIs. Today, i will help you with understanding the basics of API, how to use it with your BDFD bot & how to find new APIs.

First, we have to understand what is API. API is a software that recieves requests and gives back answers. Let's take Google API for example. When you search something on Google, you send a request to its API and the API gives you search results as a response.

APIs are commonly used to get stats about YouTube channels, generate images based on input or to get popularity of search terms, take Google Trends for example. But i am pretty sure that when someone from the BDFD community says API, they mean the image generation API.

Servers communicate with APIs through a set of rules that define how computers, applications or machines can talk to each other. That basically means that they send requests to the API servers. The only way that most bots can communicate with API is through URL adresses. Just by loading the website and accessing it, the website knows that someone tried to access the website and it can consider that as a request. For example, when you click on a Twitch stream, the website knows that someone joined the stream and the viewer count goes up.

So now we know how request are being sent and recieved, but if you do just that in your browser, you might get error that you need to provide input. But how would you do that? You need to use the URL. The server takes the content of URL as input. Just imagine this website is API, the /l/api-basics in the URL is input and this page is response.

Now that you understand how API works, try to take a minute to read this URL and guess what will there be if you click at it.

https://api.alexflipnote.dev/drake?top=top text&bottom=bottom text  

Note: when using API, replace all spaces with %20

Now i am pretty sure that you understand API. Now how to find the right API? Well, we can use all sorts of scripts as long as it takes input from the URL. If you saw my previous article on text to image command, you know that i used flamingtext.com's script to generate images from input in the URL. Websites don't have to be considered as API if we want to use them, take for example this web that generates Minecraft achievements.

Here is the list of some of the best APIs i use:

AlexFlipnote API

has a lot of meme image generation

Useless API

can generate a lot of memes as well

Ninestats API

stores Fortnite statistics. The link i attached shows updated deals in Fortnite item shop

random-d.uk

just gives you a random cute duck. I included it just to make your day better. 🦆

wttr.in

is super simple and great site that gives you weather in good ACSII style

CTK API

is a little strange. There is no documentation of it and the only thing that we can confirm it can do is the Clyde command. And it also masks its URL, so no one will steal your command.

Thanks for reading my article. Hope you enjoyed it! Ping me (tobiagamesyt#5852) in the official BDFD server if you have any questions!

Thumbnail of this article
Thumbnail of this article
Create your website for free! This website was made with Webnode. Create your own for free today! Get started