You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The objects API only allows to query for one object at a time:
importrequestsimportpandasaspd# get data for ZTF21aaxtctvr=requests.post(
'https://fink-portal.org/api/v1/objects',
json={
'objectId': 'ZTF21aaxtctv',
'output-format': 'json'
}
)
# Format output in a DataFramepdf=pd.read_json(r.content)
When we want to search for many candidates, we loop over on the client side. But this is inefficient (many communications between the client and the server), and it would be better to group all objectId in one query:
importrequestsimportpandasaspdmylist= ['ZTF21aaxtctv', 'ZTF21abfmbix', 'ZTF21abfaohe']
# get data for many objectsr=requests.post(
'https://fink-portal.org/api/v1/objects',
json={
'objectId': ','.join(mylist),
'output-format': 'json'
}
)
# Format output in a DataFramepdf=pd.read_json(r.content)
The text was updated successfully, but these errors were encountered:
The
objects
API only allows to query for one object at a time:When we want to search for many candidates, we loop over on the client side. But this is inefficient (many communications between the client and the server), and it would be better to group all objectId in one query:
The text was updated successfully, but these errors were encountered: