How do I search tweets from the past?


I am using Twitter4j library and I am trying to perform searches to get tweets and mentions from specific dates / date ranges in the past… like a certain keyword between 2001 and 2003 for example.

I noticed that the regular Search API only gives me recent data that is like 9 or so days old. While on the website I can view all historical tweets. Is there such a functionality ? Do we have to pay for access to historical data (I don’t mind, I can pay just tell me where) ?