Reading a panel api v2 services list: the fields that actually matter

in API & Integration · 0 replies · 0 views

Admin

Most panels run Perfect Panel or something that imitates it, so a POST to /api/v2 with action=services and your key returns a JSON array. We read a few thousand of these a day, so some notes on what is in there. Fields you can mostly trust: service (the id), name, rate, min, max, category. Fields that vary more than you would like: service is not always a number. Some panels return a string like s3237. If your code runs Number() on that you get NaN, and if you then key anything by it, every row collapses into one. Ask us how we know. refill and cancel are sometimes booleans, sometimes 0 and 1, sometimes absent entirely. rate is per 1000 units, except for package priced services, where it is per package. A listing named Bluetick 1 Follower at 1.04 is not comparable with anything priced per thousand. type is nearly useless for telling services apart. The name carries the real information, which is why we parse the name rather than trusting the field. If you are integrating and hitting something stranger than the above, post the shape of the response. Minus your key, obviously. Never paste an API key into a forum post, here or anywhere. If your own panel API returns something we fail to read, that is worth a topic too. Several of our parser fixes started as somebody asking why one panel errored.

Sign in to reply.

Sign inCreate account