Random user
Generated placeholder people with names and pictures.
- Web
- Since 0.2.0
- addon
- random
- people
- names
- placeholder
- web
- data
Random user fetches made-up people from randomuser.me: names, places, e-mail addresses and portrait pictures. It needs no key. The people are generated; none of them is real.
What it does#
The node is generated from the randomuser addon manifest. It requests GET https://randomuser.me/api/ with its parameters and runs it like a Web request. response is JSON with a results list of people and an info block with the seed used.
With trigger cabled each trigger asks; otherwise a change on a cabled parameter port does; with no cable at all it asks once at start.
A Toy using this node requires the network and the randomuser addon, enabled in Settings → Addons.
When to use it#
Use it for playful data: name the voices of a choir, place a sound on a map, or test a data chain with realistic-looking values.
Ports#
| Port | Direction | Signal | Lanes |
|---|---|---|---|
trigger | Input | Data (trigger) | 1 |
results | Input | Data (integer) | 1 |
nat | Input | Data (string) | 1 |
seed | Input | Data (string) | 1 |
inc | Input | Data (string) | 1 |
response | Output | Data (json) | 1 |
status | Output | Data (integer) | 1 |
error | Output | Data (string) | 1 |
done | Output | Data (trigger) | 1 |
Parameters#
| Parameter | Label | Range | Default | Unit | Scale | Notes |
|---|---|---|---|---|---|---|
results | Results | 1 to 100 | 1 | linear | People per request, 1 to 100. Used while the port has no cable. |
nat: text.seed: text.inc: text.
Results (results)#
How many people one request returns, 1 to 100.
Nationalities, seed and fields#
The nat field limits nationalities (comma-separated codes such as us,gb,fr); the seed field makes the same request return the same people; the inc field lists the fields to include, such as name,location,picture. Each is used while its port has no cable and left out when empty.
Tips#
- A fixed
seedmakes a piece repeatable, like a seeded Random. - Pick a first name with Convert and path
/results/0/name/first.
See also#
Random, Convert, Console log, Data cables.
Help patches
Each help patch is an ordinary Toy that teaches one idea. The diagram shows the Patch; the preview shows its Frame. Open it in TuneToys to play and edit it.
1. A random name
beginner Teaches: results
Random user fetches a generated person every ten seconds; Convert picks the first name.
Connections as text
- Cron tick output connected to Random user trigger input
- Random user response output connected to Convert value input
- Convert value output connected to Console log value input
- Results sets how many people each request returns.
- inc limits the fields to keep each response small.
Related nodes
- Random Make a random number, integer, boolean, string, colour or choice on each trigger; seeded when a seed is wired.
- Convert Convert a value to another datatype, optionally picking a field or formatting a string; failures go to error.
- Console log Write each incoming value to the Console panel with a level and label, rate-limited.