This is a lambda which can be used to proxy requests to Twitter's API, using AWS Lambda. It uses BoyCook/TwitterJSClient to make. limited, but 100% compliant API calls and can be easily extended to do more.
Live demo via AWS Gateway API endpoint
Clone this repository and install the missing npm
packages.
cd twitter-client-aws-lambda
npm install
Before deploying, make sure that you have configured config.js
and replaced the required API keys with yours.
In order to deploy the package, either use the aws-cli
tool or zip the contents of the repository (node_modules
included!) and upload them to AWS lambda using the user interface
Since this is a proxy service, it is going to need an AWS Gateway API endpoint to be generated for it eventually. The HTTP API, performs differently and accepts different parameters based on the action
provided.
This lambda is made to handle data being sent in both query strings or request body, so you can use either POST or GET for your requests to the lambda.
This is your standard Tweet search, the API accepts the following parameters:
q
- search stringmax_id
- used for pagination, the API will providesearch_metadata.next_max_id
in your search responsescount
- amount of results to be returnedgeocode
- lonlat location with radiuslocale
- origin user localelang
- search language
Search through the Twitter user accounts. Accepted parameters:
q
- search stringpage
- search results pagecount
- number of results returned per page
Retrieves posts by Twitter User ID:
id
Retrieves posts by Twitter screen name, params:
screen_name
Retrieves a single tweet by ID, params:
id