As explained in the DOCS ,
The recent search endpoint allows to get topics for the last 7 days.
However, it seems there is no way to filter within these 7 days. The query looks like this:
https://api.twitter.com/2/tweets/search/recent?query=Barcelona contaminación&tweet.fields=public_metrics,author_id,created_at
How to filter by date within those 7 days?
Thanks