Export list of nodes

In ZeroTier central I have over 30 nodes. Every node has it’s own address, ip number and name. Is there any way to export that list to csv or txt?

Hello!

There isn’t really a built in export in my.zerotier.com

If you browse to
https://my.zerotier.com/api/network/${network_id} and
https://my.zerotier.com/api/network/${network_id}/member
that’ll give you the info in JSON

copying and pasting the members list into a spreadsheet seems to leave out some of the important info. That’d be nice to have working.

There are some command line ways to get the text members list.

1 Like

It is exactly what I need :smile: Thank you!

Hi,

Sorry to reply to such an old thread. This method now just returns “Forbidden”

I cannot find a comprehensive list of what the CLI can do, so would you mind providing the method of listing all member nodes?

Thanks!

B.

Thanks, I looked at that, but could make no head or tail of it.

Are there any examples of how to use the api from a web browser? Also, what about the statement above:

There are some command line ways to get the text members list.

and why doesn’t this work?

https://my.zerotier.com/api/network/${network_id}/member

Many thanks in advance

B.

Long story, but the way authorization happens now, it doesn’t work anymore.

curl -X GET -H "Authorization: token xxxxx" https://api.zerotier.com/api/v1/network

I think what we’re finding out is people want a button on the webpage to export the network config and member list.

1 Like

Many thanks for that, I will see if I can make it work.

I take it there are in fact no command line methods to achieve this?

I’d be happy with that if there were.

B.

The curl command Travis posted above is the closest thing there is. The zerotier-cli command does not interact with the web API at my.zerotier.com at all.

1 Like

Hi!

Success at last! Many thanks for that. I must say the API documentation is a little obscure. Also it would be nice to point out that the curly brackets around the network id are not compulsory… they work ok on the command line, but they need to be removed for a node red HTTP node.

Thanks!

B.

Hi,

any idea why I can’t get the member in the network with this ?

curl -X GET -H “Authorization: token *************” https://api.zerotier.com/api/v1/network

I get the json of all my networks specification (Id, IP range, etc…) but nothing about the members of my networks. Even using a specific token I do not get the list of the members of the said network… any ideas?

@robert.vergnes The API endpoint you’re hitting is for the list of all networks accessible to your account.

To get a single network, hit: /api/v1/network/${NETWORK_ID}

To get the list of members of a network, hit: /api/v1/network/${NETWORK_ID}/member

To get an individual member of a network, hit: /api/v1/network/${NETWORK_ID}/member/${MEMBER_ID}

API documentation can be found here

1 Like

Indeed yes, I figured this out…
curl -X GET -H “Authorization: token **********************************” https://api.zerotier.com/api/v1/network/${NETWORK_ID}/member > Member-List_MyNetwork.json

did it fine. Thanks

Glad you figured it out. I also edited your post so that you’re not publishing your network ID to the world :wink:

This may help people needing to do this in the future.

I wrote a contextual CLI for ZeroTier. It has functions to show all peers as well as pull the details for any active peers.

  • show peers detail - This will pull a list of the peers that are active and provide information about the nodes not present in “zerotier-cli peers”
  • show peers all - This will list all of the member info within your ZeroTier account (across all networks)

The script can be found here: GitHub - l0crian1/ztcli: Contextual CLI for ZeroTier written in Python

  • Place ztcli.py in the zerotier-one folder and run it from there.
  • When trying to run either “show peers all” or “show peers detail”, it will look for an API configured in the “zt_central_api.secret” file, and if not found, will ask you to input an API key. You should create an API key in ZeroTier Central beforehand.