About < getTrades > api

If i use getTrades api and returned jsons are too long , are they trim the result or send back all of the result?

It limits to 100 items returned. If you want more then you need a loop with adjusting firstIndex and lastIndex or provide the adminPassword to that node

How can i use it? ( I know there is option to use index , but i don't know details )
And when i use localhost, also need adminPassword?

I don't think localhost needs the adminPassword, but am not 100% sure.
The default api call would have the parameters:

firstIndex: 0
lastIndex: 99

So if you wanted the next 100, you would do the API call with

firstIndex: 100
lastIndex: 199

and etc to get the rest

Actually you only need the firstIndex parameter, then you will get up to 100 records from that index. If you got 100 then you can repeat the call with the firstIndex increased with 100 to fetch the next records. Repeat until you get less than 100 records.

1 Like

When I set nxt.properties file to nxt.maxAPIRecords=1000 , it can receive 1000 records on there node?

Yes, that setting controls the maximum (default if not specified) number of records returned on a single request.