great-usernames-api

The great usernames api is a api that provides usernames using a stripted down version of the Great Usernames Engine

This is a RESTful API to provide the features of the great usernames engine on the web, the Great Usernames website is a good example of what can be done with this API

Usage

The API is hosted on Deta and is made with the FastAPI framework Using the API is very simple. To get started you can

THE BASE URL OF THE API IS https://n8w3zk.deta.dev

Get a single username

To do this you can make a HTTP GET request on https://n8w3zk.deta.dev/get_one_username/ this endpoint. Here is some sample python code to get you started

import requests

print(requests.get('https://n8w3zk.deta.dev/get_one_username/').json())

After executing, you may get a response like (the username generated each time will be new so dont worry if the usernames dont match because every username will be unique)

{'username': 'confocal212'}

Get a number of usernames at the same time

This request can be made to do get multiple usernames at once. WARNING: ONLY 20 USERNAMES WILL BE GENERATED AT ONCE, REQUSTING MORE THAN 20 WILL RAISE A HTTP 400 (BAD REQUEST) ERROR to increase this limit you will need to self host, for that see Self Hosting section of this limit

To do so you can make a HTTP GET request on the https://n8w3zk.deta.dev/get_a_number_of_usernames/ endpoint along with the number parameter

Some sample code to get you started

import requests

print(requests.get('https://n8w3zk.deta.dev/get_a_number_of_usernames/', {'number': 10}).json())

## To test in the browser, go to some url like https://n8w3zk.deta.dev/get_a_number_of_usernames/?number=10

You can change the 'number' in the payload to anything between 1 and 20. After making the request, you may get a response like the following

{'usernames': ['complacent876', 'stationarity935', 'infuse25', 'tutor659', 'Kendall743', 'dutiful596', 'Hinman206', 'Goa473', 'culinary168', 'biscuit662']}

This gives you a array of usernames. In this case we get 10 unique usernames because we requested two usernames

For more info you can

  • Create a issue on this repo (I will be happy to answer your queries)
  • go to the root url https://n8w3zk.deta.dev/ for some general info
  • Go to the /docs and /redoc urls listed above

Self Hosting

for self hosting, refer Self Hosting.md To increase the username per request limit, also see the same document

Contributing

PR's are accepted. The source code for the API can be found in the The main.py inside the great usernames api folder. To run the app on localhost, see Running on localhost