How i extract this data from BM using api?

Im noob and its my first time trying to understand how api works, also im way bellow the "beginner" stage in programming... What im trying to do right now is get the monthly unique players value from a specific server in this case its "https://api.battlemetrics.com/servers/8113868/unique-player-history" i put some code into a php file and the result is this: Array ( [data] => Array ( [0] => Array ( [type] => dataPoint [attributes] => Array ( [timestamp] => 2024-01-01T00:00:00.000Z [value] => 935 ) ) ) ) wich i guess the number of unique players on 1st of january of 2024 was 935, right? If this is true and ive done everything right, the next question is how i store this data for more then 3 months? Do i need a data base? Becouse it seems i can only get information based on the last 3 months, so i think i need to store all these values in a db and sum them up and have them displayed on my web? I have no ideea if what ive said even make sense but if someone can help me with some suggestions or make me understand this i would highly apreciate it!
No description
4 Replies
[MIG] EOC LongBarrel
If you want to store data, you need a spot to do so yourself (yes database) once you have a base level, you can query it more often say once every 7 days & grab a new number of 7 days worth of data and add that, Other wise you need to wait every 3 months to pull new data. Pretty much every query point needs to use the time it was sent last. Other option (unsure where in API it is, is ORG data.) This is if your using BM RCON. https://www.battlemetrics.com/organizations/5710 This shows some other information, Also handy if you have multiple servers, Instead of grabbing each server, you could grab all server information at once, But as i stated, unsure where on API doc's this is located.
ArcticParadise
ArcticParadise5mo ago
@[MIG] EOC LongBarrel I would prefer grab the new player count on daily basis, and i think same would go for monthly and banned players ALso i dont really understand this: Pretty much every query point needs to use the time it was sent last.
[MIG] EOC LongBarrel
You could use the ORG Data to gather player count for 24 hour's also. As per the time, Send Query 1 now with 3 month pull - Start=2023-11-09T12:00:00.000Z Your next query would be 24 hours later - Start=2024-01-09T12:00:00.000Z Then 24 hours later you run it again - Start=2024-01-10T12:00:00.000Z - This time adding a day to the query) Every time you query, you need to pull the time the last query was run (if the query endpoint use's a time start/end)
ArcticParadise
ArcticParadise5mo ago
@[MIG] EOC LongBarrel Can you check DMs when you free?