Skip to Main Content
 

Blog title

Binubuo - The Basics Part 2

INFO_LIST

  • Author Head Binubuo
  • Category Binubuo API
  • Created Fri, Apr 08 2022
 

blog sections

Fetching that first piece of data

In the last entry we looked at how to get a list of the available data generators supplied by Binubuo. In this entry we will take a look at how to call the generators and start getting some random data that we can play with. As always there will be plenty of examples and you can follow along with your own account (if you don’t have one, create one here).

We ended with listing all the generators in the person category. So this would be the list of generators we would get:

  • Age
  • Birthday
  • First name
  • Full name
  • Gender
  • Job sector
  • Job title
  • Last name
  • Middle name
  • Name prefix
  • Name suffix
  • Personal ID generator
  • Salary

So maybe we need some names to test out a newly developed function, so let us use that endpoint and fetch some random names. The format of the URL for generators are as follows

https://Binubuo.com/api/generator/[category]/[generator]

So if we wanted to fetch some names we should call:

https://Binubuo.com/api/generator/person/full_name

Using the REST endpoint to get the name

So to call the endpoint using cURL, all we need to supply is our API key and we are set. Below is the cURL command to fetch a name:

curl -H @{"x-binubuo-key" = "ASDF1234"} -Method GET 'https://binubuo.com/api/generator/person/full_name'

Which will return the JSON data with our randomly generated name.

{
"Full name":[
	{
		"R_NAME":"Sarah Wright"
	}
]
}

Binubuo have a few clients available that you can use to get the data, which are a bit easier and more user friendly to use. For instance we have Python client available. To install the client, just use pip to install in your environment:

$ python -m pip install binubuo

To get the full details on the python client, you can read the documentation here

Once the binubuo module is installed and imported, you can get the name with just one command after initializing your api key.

>>> From binubuo import binubuo
>>> B = binubuo(‘ASDF1234’)
>>> B.generate(‘person’, ‘full_name’)
Addison Watson

Pretty simple and straightforward.

If you are working with Oracle, you can use Binubuo directly inside the database using the PL/SQL client. Read here on how to install.

Once installed, you can generate the random name using the binubuo.generate function.

Exec binubuo.init(‘ASDF1234’)
Select binubuo.generate(‘person’, ‘full_name’) from dual;

Now you are good to go ahead and start testing out all the different generators and fetching some random data.

In the next entry we will take a look at some of the parameters you can use to control and manipulate the results from the generators.

Don't have an account yet?

If you don't have an account on Binubuo yet, you can create one real quick. Just click "Sign up" in the top right corner, and you are on your way to create all the synthetic data you could dream about.

Want to see how to get started: Get Started Guide

Get more guides and help from the blog

Follow Binubuo on Twitter:


If you already have an account on RapidAPI, you can use your account to access Binubuo

Connect on RapidAPI