Twitter API

Make Twitter APIs endpoint as search, user tweets, etc. in a few clicks

Overview

Base Endpoint

For Twitter API, the format of your endpoint ⤵️

https://v1.nocodeapi.com/<username>/twitter/<token>

- username- your nocodeapi username.

- token- every api have unique token. See your API card when you setup API.

API Error Codes:

If your query fails, API will return a 3-digit error-code and info as plain text

Error response example: If you provide a invalid key or do not send one, you will be responded with Unauthorised Access in below format.

{
    "error": 1,
    "code": 401,
    "info": "Unauthorized"
}

Common API Errors:

Code Info [affected API endpoints]
200 (OK)Standard response for successful GET, POST, UPDATE & DELETE
400 (Bad Request)Error response when creating (POST) or updating (UPDATE, DELETE).
401 (Unauthorized)Error response when wrong or invalid API key
402 (Payment Required)Returned if pro feature is tried to be accessed from free account
403 (Forbidden)Error response when action is forbidden by the user (API owner)
404 (No such route) Route is not valid or query params is in-valid.
429 (Rate limit exceeded)Your API request limit exceeded per month.
500 (Server error)Server error

API Endpoints

Get Tweets

Make the GET request on below endpoint with type query param to list all your tweets as json

https://v1.nocodeapi.com/<username>/twitter/<token>?type=home_timeline

- Request Parameters:

ObjectDescription
type[Required] Tweets of users timeline. There are three type: home_timeline, user_timeline, mentions_timeline
count[optional] Total number of records you want in one request. Default value is 20.
since_id[optional] Returns results with an ID greater than (that is, more recent than) the specified ID.
max_id[optional] Returns results with an ID less than (that is, older than) or equal to the specified ID.
trim_user[optional] When set to either true , t or 1 , each Tweet returned in a timeline will include a user object including only the status authors numerical ID.
exclude_replies[optional] This parameter will prevent replies from appearing in the returned timeline.
include_entities[optional] The entities node will not be included when set to false.

- Code Examples

const axios = require('axios');
    
axios({
    method: 'get',
    url: 'https://v1.nocodeapi.com/<username>/twitter/<token>', 
    params: {type: 'home_timeline'},
}).then(function (response) {
        // handle success
        console.log(response);
}).catch(function (error) {
        // handle error
        console.log(error);
})

Search Tweets

Make the GET request on below endpoint with q query param to search tweets.

https://v1.nocodeapi.com/<username>/twitter/<token>/search?q=comedy

- Request Parameters:

ObjectDescription
q[Required] A UTF-8, URL-encoded search query of 500 characters maximum, including operators. Queries may additionally be limited by complexity.
lang[optional] Restricts tweets to the given language, given by an ISO 639-1 code. Language detection is best-effort.
result_type[optional] Specifies what type of search results you would prefer to receive. There are three types mixed, recent, popular
since_id[optional] Returns results with an ID greater than (that is, more recent than) the specified ID.
max_id[optional] Returns results with an ID less than (that is, older than) or equal to the specified ID.
include_entities[optional] The entities node will not be included when set to false.

- Code Examples

const axios = require('axios');
    
axios({
    method: 'get',
    url: 'https://v1.nocodeapi.com/<username>/twitter/<token>/search', 
    params: {q: 'comedy'},
}).then(function (response) {
        // handle success
        console.log(response);
}).catch(function (error) {
        // handle error
        console.log(error);
})

Make a Tweet

Make the POST request on below endpoint with status query param to tweet.

https://v1.nocodeapi.com/<username>/twitter/<token>?status="tweet coming from nocodeapi"

- Request Parameters:

ObjectDescription
status[Required] text that you wanna tweet

- Code Examples

const axios = require('axios');
    
axios({
    method: 'post',
    url: 'https://v1.nocodeapi.com/<username>/twitter/<token>', 
    params: {status: 'tweet coming from nocodeapi'},
}).then(function (response) {
        // handle success
        console.log(response);
}).catch(function (error) {
        // handle error
        console.log(error);
})