# How to get full text tweets with the codebird?

**URL:** <https://discourse.processing.org/t/how-to-get-full-text-tweets-with-the-codebird/26086>\
**Category:** Libraries\
**Created:** [December 9, 2020, 11:07am UTC](https://discourse.processing.org/t/how-to-get-full-text-tweets-with-the-codebird/26086 "2020-12-09T11:07:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kokopo](https://avatars.discourse-cdn.com/v4/letter/k/3d9bf3/32.png) [@kokopo](https://discourse.processing.org/u/kokopo)\
**Post date:** [December 9, 2020, 11:07am UTC](https://discourse.processing.org/t/how-to-get-full-text-tweets-with-the-codebird/26086/1 "2020-12-09T11:07:04Z")

</div>

I want to use a twitter api to search tweets in P5,  
and came across this codebird api

> **[p5.js Web Editor](https://editor.p5js.org/brysonian/sketches/rJZ1BCd1f)**

but the tweets returned are truncated, is there a way to get full text?  
Thank you 🙂

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [December 12, 2020, 12:23am UTC](https://discourse.processing.org/t/how-to-get-full-text-tweets-with-the-codebird/26086/2 "2020-12-12T00:23:46Z")

</div>

Hi,

Welcome to the community! 😉

This issue is not really related to `p5.js` but here is the aswer :

> <https://stackoverflow.com/questions/38717816/twitter-api-text-field-value-is-truncated>

Looks like the Twitter API changed and you need to use the `tweet_mode` to `'extended'` in the search query :

```auto
var params = {
  q: "power",
  result_type: 'recent',
  count: 100,
  tweet_mode: 'extended'
};

```

And then the full text is obtained with :

```auto
let full_text;
if (tweet.retweeted_status) {
  full_text = tweet.retweeted_status.full_text;
} else {
  full_text = tweet.full_text;
}

```

(test if it has been retweeted otherwise get the full text)

Please also remember that **it’s not recommended to put your API key public** on internet since you can also post and modify data as stated here in the Codebird documentation :

> ⚠ Because the Consumer Key and Token Secret are available in the code, it is important that you configure your app as read-only at Twitter, unless you are sure to know what you are doing.
