storjnet-info icon indicating copy to clipboard operation
storjnet-info copied to clipboard

How to use the Useful APIs

Open Leohoo27 opened this issue 3 years ago • 5 comments

curl --user username:password --data 'data' https://storjnet.info/api/user_texts

Leohoo27 avatar May 14 '21 11:05 Leohoo27

What do you mean? Do you suggest describing /api/user_texts in the "Useful APIs" readme section?

3bl3gamer avatar May 14 '21 20:05 3bl3gamer

What do you mean? Do you suggest describing /api/user_texts in the "Useful APIs" readme section?

Hi, i think he wanted similar thing as me.

Is it possible to send cURL API requests to storjnet.info, to get neighbors check? Not just via website?

just like we use uptimerobot to update monitor using: curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'api_key=enterYourAPIKeyHere&format=json&id=777712827&friendly_name=newFriendlyName' "https://api.uptimerobot.com/v2/editMonitor"

(its from https://uptimerobot.com/api/)

i was thinking about some

curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'subnets=192.168.0.1&format=json' "https://storjnet.info/api/neighbors"

192.168.0.1 is just example, but it does not work obviously with real ip too

im writing this becaus ei want to code that in autoit so it will check once a day to check if i have suddenly a neigbour or not. I managed to transalte that cURL to autoit so it works for uptimerobot to update monitor. Just need same to check for neigbors, Best wishes.

ruskieo avatar Jul 04 '23 19:07 ruskieo

Neighbours API is described at https://github.com/3bl3gamer/storjnet-info#useful-apis

It exactly fits your needs, doesn’t it? GET mode is for single IPs, POST mode for multiple.

3bl3gamer avatar Jul 07 '23 04:07 3bl3gamer

Neighbours API is described at https://github.com/3bl3gamer/storjnet-info#useful-apis

It exactly fits your needs, doesn’t it? GET mode is for single IPs, POST mode for multiple.

Yea but im sorry, im clueless in programing commands still, i was unable to formulate a correct command up on this informations, How does it should look? like this?

curl -X GET -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d '192.168.0.1&format=json' "https://storjnet.info/api/neighbors"

(i got some Method not allowed, or a whole html of a website in response)

ruskieo avatar Jul 07 '23 22:07 ruskieo

If you need to check single IP, you can do just curl https://storjnet.info/api/neighbors/192.168.0.1, it will be GET by default.

3bl3gamer avatar Jul 11 '23 07:07 3bl3gamer