This data comes from the Facebook Ad Library report, which Facebook provides as part of its transparency efforts.
It's all a bit messy because Facebook does not appear to put any effort into making this efficient or simple and actively seems to avoid making it accessible outside of their own, rather horrible, API. You can access the Library directly but then you have to manually build a search each time you use it.
This gadget always shows the total spend from August 2020 to the beginning of the current month in the top card and the last 90 days to date in the bottom card.
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
This is offered entirely 'as is' and should not be relied upon for any decisions of any sort.