API Not Returning All Results

67 views
Skip to first unread message

John Reyes

unread,
Dec 27, 2016, 2:28:39 PM12/27/16
to aprs.fi

I'm running into an issue with the API not returning all results. If I query like this:


I get the following output:

{"command":"get","result":"ok","what":"loc","found":1,"entries":[{"class":"a","name":"N1SKB-7","type":"l","time":"1482864369","lasttime":"1482864369","lat":"42.84667","lng":"-73.76983","altitude":87,"course":357,"speed":74.08,"symbol":"\/[","srccall":"N1SKB-7","dstcall":"TRUP8P","mice_msg":"111","path":"K2DLL-2,WIDE1,KA2QYE-10,WIDE2*,qAR,WB2ZII-15"}]}

but if I query this:

http://api.aprs.fi/api/get?name=SARRT7-i&what=loc&apikey=[API KEY]&format=json

I get this even though I can search for it through the web interface:

{"command":"get","result":"ok","what":"loc","found":0,"entries":[]}

Does anyone know what would cause one callsign to show up via the API but not another?

Heikki Hannikainen

unread,
Dec 27, 2016, 3:26:21 PM12/27/16
to aprs.fi

Hi,

On Tue, 27 Dec 2016, John Reyes wrote:

> I'm running into an issue with the API not returning all results. If I query like this:
>
> but if I query this:
>
> http://api.aprs.fi/api/get?name=SARRT7-i&what=loc&apikey=[API KEY]&format=json
>
> I get this even though I can search for it through the web interface:
>
> {"command":"get","result":"ok","what":"loc","found":0,"entries":[]}
> Does anyone know what would cause one callsign to show up via the API but not another?

The catch here is that SARRT7-i is a "web station", and the names of those
are not unique, much like the names of AIS vessels. There can be multiple
SARRT7-i's out there, and the api/get endpoint is for getting information
about a specific station, not for searching stations.

When you look up SARRT7-i on the web site and browse around, you'll notice
the web site URLs refer to it as w/3397515266, which is an unique
identifier for that station, and it'll continue to work even if you
*rename* that station to SARRT9-Ö later on. Also, if someone else decides
to beacon as SARRT7-i using the app at the same tiem, their positions will
not be interfering with yours.

http://aprs.fi/info/w/3397515266
http://aprs.fi/#!call=w%2F3397515266&timerange=3600&tail=3600

So, try name=w%2F3397515266 instead (note, URL parameter encoding for the
'/' of course).

This is a bit of a FAQ item, a few people have asked along the lines of
"I'm trying to use the API try fetch the position of the boat named
VIKING" (http://aprs.fi/#!call=viking). For AIS, they need to use the MMSI
number to query as it is a bit more unique.

- Hessu

John Reyes

unread,
Dec 27, 2016, 11:55:34 PM12/27/16
to aprs.fi
Thank you very much. That was my problem. I should note however that it didn't work with the w%2F prefix but using just the integer itself returned the results I was expecting. Thanks for all the work you do on this project.
Reply all
Reply to author
Forward
0 new messages