-
Notifications
You must be signed in to change notification settings - Fork 2
userlist api
-
Name:
userlist
-
Returns:
application/json
-
URI Template Variables:
{letter}
- Availability: API Server
Returns JSON describing listing all users whose nicknames begin with the
lowercase ASCII letter specified via the {letter}
URI template variable. All
PGXN usernames must start with such a letter, so it's possible to iterate over
all 26 letters to get a complete list of users. If no users exist with
nicknames beginning with the specified letter, a 404 will be returned.
The JSON returned will be a single array. The users are listed in the array in alphabetical order by nickname. Each one is represented by a JSON objet with two keys:
Key | Type | Description |
---|---|---|
user |
String | The nickname of the user. |
name |
String | The full name of the user. |
More information about a user can be fetched by passing the name
value to
the user API's {user}
URI template variable.
Example:
[
{
"name": "Alexey Klyukin",
"user": "alexk"
},
{
"name": "Álvaro Herrera",
"user": "alvherre"
},
{
"name": "Andrew Dunstan",
"user": "andrew"
},
{
"name": "Marcel Asio",
"user": "asio"
}
]
Assuming you have retrieved the JSON document from the index API
and stored the data in the $table
hash, you can fetch the JSON listing all
users whose nicknames start with "a" like so:
use URI::Template;
use HTTP::Tiny;
use JSON;
my $tmpl = URI::Template->new($table->{userlist});
my $uri = $tmpl->process({ letter => 'a' });
my $req = HTTP::Tiny->new;
my $res = $req->get('https://api.pgxn.org' . $uri);
my $dist = decode_json $res->{content};
If you have any questions about the PGXN Mirror and API Server APIs, please post them to the PGXN Users list. If you find any bugs in the API, please report them. To follow news about PGXN, subscribe to the blog and the Mastodon stream.