Generating random passwords, numbers and GUIDs with the PasswordRandom API

Full article

Some of the API's I've written about give you access to data - public data like ISS sightings and amazing space photos, and personal data like your Instagram photos and Dropbox files - but an API can return other things too. Here's an API that returns random numbers, GUIDs and other values, and provides an opportunity to customize what it returns.

Two things before you get started:

  • If you're unfamiliar with APIs, you might want to read this first to familiarize yourself with them.
  • You may want to install Postman, which allows you to access API endpoints without having to write an app, as well as save the calls you make and sync them online between your computers.

What does it provide?

The PasswordRandom API provides random values - and not just passwords as the name would seem to suggest. It also generates GUIDs, random numbers, characters, etc. Better yet, it has parameters for the number of results you get back (like 10 GUIDs at once), and other ways to configure or limit the numbers and passwords you get back too.

If you're developing an app that will, for whatever reason, generate a GUID or return such a value to the user, you have a choice. Some languages have built-in libraries that return a GUID for you. Others require downloading a third-party and taking on another dependency. If you didn't want that dependency for some reason, you could call this API instead. As for everything else it offers.. well, you may find a reason to use it, so let's check it out.

Taking it out for a spin

This API doesn't require any authentication, nor does it have documented rate limits. You can request the format (plain, xml, json) and other filters too.


You can specify the number of globally unique identifiers (GUIDs) you'd like back, as well as the format in which to return them.

And that returns 5 GUIDs in JSON format, like this:

    "char": [


You can also get random integers...
<?xml version="1.0" encoding="UTF-8" ?>

... as well as random floats.
<?xml version="1.0" encoding="UTF-8" ?>

Strangely, getting random floats with a range only works if the range is integers. If you try to specify a max of 18.2, it returns values all over the place... even outside the default range of 0 to 100.
<?xml version="1.0" encoding="UTF-8" ?>


A note about generating passwords using an API like this. I probably wouldn't recommend it for passwords, but it could be useful for generating randomized strings. If you did use it for passwords, it's not like the site serving the API could know what account you'll use it for, but then it'd help if it were at least served over SSL so no one watching the network could sniff it...

Here's 8 random passwords:
    "char": [

If you click on the scheme link next to "password" field, you'll find a lot more options to generate the exact string you need.

For example, if I needed a password for a system that required a length of 8, and at least one upper, one number, and one special symbol, I could request:!

Or if you just wanted to generate 10 random phone numbers for some mockup:


Grant Winney

I write when I've got something to share - a personal project, a solution to a difficult problem, or just an idea. We learn by doing and sharing. We've all got something to contribute.

Comments / Reactions

One of the most enjoyable things about blogging is engaging with and learning from others. Leave a comment below with your questions, comments, or ideas. Let's start a conversation!