Make your own AI Chatbot for free

PGamerX
3 min readSep 6, 2021

This article will guide you on how to make your own AI chatbot easily and absolutely free!
Prerequisites:
1. Basic knowledge about the coding language you are planning to use
2. Basic knowledge about HTTP request(s)

Will I learn Machine Learning?

No, this article will not teach you machine learning, but, this will teach you how to make your own AI-Chatbot using Random Stuff Api.

But what’s the point of doing so?

Not every application/software/website has an AI-powered chatbot to help you kill your boredom. You can implement this AI chatbot in any mobile application, any Discord bot, any WhatsApp bot, any Facebook bot, any Social Media bot, any website, any desktop application, and much more…

Damn, can I make it using [x] coding language?

Of course, you can! Random Stuff Api is a Rest API that can be fetched using any language that’s available Wikipedia’s list of programming languages

Finally, it's the time…

Steps involved in making your own ai-chatbot

1. Reading the Documentation

Now, this might not sound like a really important step but believe me, it sure is. Reading documentation helps you understand how the API/module works
Links for the documentation for Random Stuff Api -

Version 5 (Recommended)
Version5 is the latest version and is recommended. This is what we are going to cover up in this article

Version 4
Version4 is the second-latest version of RSA but it lacks a lot of features that are present in Version5

Version3 (Deprecated)
I honestly don’t know why anyone would wanna use this version as this was one of the worse versions ever.

2. Setting up the coding environment

Oh, now we talkin’. Make sure to do the following things (In-order of course)
1. Initiate your project in any language you desire.
2. Launch your favorite IDE
3. Add a file
and boom! we are ready to get into the real coding.

3. Getting the input from the user

We first want to receive input from the user i.e a message user will send which will then be sent to the API to get an appropriate response.
There are various ways you can get user input(s) like -
1. input() method in python
2. readline package in nodeJS
and much more….

4. Basics of fetching the response from API

As mentioned in the docs, you have to make a GET request to the API

Base URL
The Base URL is https://api.pgamerx.com/v5/ai, but we have to add few parameters i.e message and server. Also there are some others which we may wanna add for full customisation. So our Base URL becomes https://api.pgamerx.com/v5/ai?message=user_message&server=main

Headers
We have to send our API key as Authorization in the header. API key can be obtained for free at This Page

5. Actually fetching the response

Now, we just need to make a HTTP request to the API. There will be examples of how to fetch the API in python and javascript below.
For other languages — Check this website

Fetching API in NodeJS
(We are going to use node-fetch package for this)

Fetching API in Python
(We are going to use request package for this)

6. Other questions

If you need support with anything else, you can check out Random Stuff Api’s official Discord server for support

Conclusion

So, you have made it this far, congratulations!
I hope you have understood everything so far and are on your way to spice-up your application(s) with other features of Random Stuff Api as well!
Good luck with your journey ❤

My Discord server
My email address
Donate me

--

--

PGamerX

A self-learning Developer who is always eager to make more projects/articles to help other users. You will find articles related to different languages here.