Smollbite Icon
SmollBites
Email logo

Mock: Your Sample Data

Create a mock API endpoint in a flash

The problem

Sometimes we're just playing around with a framework or library we want something different data, like a data structure that didn't exist in ages. But we don't want to create an API for a simple or for a test thing-ish.

The solution

Mock, a service that you can ask for a mock data based on your preffered structure.

Generating a payload

To Generate a payload head into the Mock Generate page and construct the payload you want.

For example in the payload below, it'll generate a random first name and a static value Check it here.

javascript
{
  "first_name": "!FIRST_NAME",
  "im_static": "Hello world!"
}

How to use?

Generate an endpoint with a payload at Mock Generate page and after generating, tadaaa! your API endpoint.

You can now use it like this:

javascript
fetch('https://mock.smollbites.com/CODE')
.then((response) => response.json())
.then((response) => {
  console.log(response)
})

Available data to be generated

  • !FIRST_NAME - Generate a first name
  • !MIDDLE_NAME - Generate a middle name
  • !LAST_NAME - Generate a last name
  • !ADDRESS - Generate an address
  • !TEXT - Generate a random sentence
  • !LATITUDE - Generate a latitude for example 4.0289
  • !LONGITUDE - Generate a longitude for example -139.537447
  • !EMAIL - Generate an email
  • !TIMESTAMP - Generate a timestamp for example 1717939599

You can hit me up via email so that I can more what you need ✨