TLDR: diffrent responses for same api call, regarding same tweet objects

Hi, I’m experiencing unreliable responses from the API, for tweets and user timelines endpoints.
This one really makes me scratch my head and it’s the 3’rd day lost on the subject with trying to wrap my head around the issue. I need the answer to one simple question, how to get consistent results every time and why is this harder then it should be?

To replicate, i’m using this call in Postman:
https://api.twitter.com/2/users/1388385126652944384/tweets?max_results=5&until_id=1478724358642282506&expansions=attachments.media_keys&tweet.fields=attachments,author_id,created_at,entities,lang,referenced_tweets&media.fields=media_key,preview_image_url,url

  {
    "data": [
      {
        "id": "1478724068023095299",
        "author_id": "1388385126652944384",
        "text": "Bored Ape #4344 was purchased for 69.69 ETH \n https://t.co/gWnkcW8KsY",
        "entities": {
          "urls": [
            {
              "start": 46,
              "end": 69,
              "url": "https://t.co/gWnkcW8KsY",
              "expanded_url": "https://opensea.io/assets/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d/4344?ref=0x079f2dA348Fc863FDc1A2B995B4796b8fAA25e48",
              "display_url": "opensea.io/assets/0xbc4ca…",
              "images": [
                {
                  "url": "https://pbs.twimg.com/news_img/1478724071726759937/K0K2cbxB?format=png&name=orig",
                  "width": 631,
                  "height": 631
                },
                {
                  "url": "https://pbs.twimg.com/news_img/1478724071726759937/K0K2cbxB?format=png&name=150x150",
                  "width": 150,
                  "height": 150
                }
              ],
              "status": 200,
              "title": "4344 - Bored Ape Yacht Club | OpenSea",
              "description": "The Bored Ape Yacht Club is a collection of 10,000 unique Bored Ape NFTs— unique digital collectibles living on the Ethereum blockchain. Your Bored Ape doubles as your Yacht Club membership card, and grants access to members-only benefits, the first of which is access to THE BATHROOM, a collaborative graffiti board. Future areas and perks can be unlocked by the community through roadmap activation. Visit www.BoredApeYachtClub.com for more details.",
              "unwound_url": "https://opensea.io/assets/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d/4344?ref=0x079f2dA348Fc863FDc1A2B995B4796b8fAA25e48"
            }
          ]
        },
        "lang": "en",
        "created_at": "2022-01-05T13:44:25.000Z"
      },
      {
        "id": "1478724045617209346",
        "author_id": "1388385126652944384",
        "text": "Mutant #1225 was purchased for 19.0 ETH \n https://t.co/3bSFeyQ0w8",
        "entities": {
          "urls": [
            {
              "start": 42,
              "end": 65,
              "url": "https://t.co/3bSFeyQ0w8",
              "expanded_url": "https://opensea.io/assets/0x60e4d786628fea6478f785a6d7e704777c86a7c6/1225?ref=0x079f2dA348Fc863FDc1A2B995B4796b8fAA25e48",
              "display_url": "opensea.io/assets/0x60e4d…"
            }
          ]
        },
        "lang": "en",
        "created_at": "2022-01-05T13:44:20.000Z"
      },
      {
        "id": "1478719714973134851",
        "author_id": "1388385126652944384",
        "text": "Mutant #9603 was purchased for 18.49 ETH \n https://t.co/tUbnTyH7sY",
        "entities": {
          "urls": [
            {
              "start": 43,
              "end": 66,
              "url": "https://t.co/tUbnTyH7sY",
              "expanded_url": "https://opensea.io/assets/0x60e4d786628fea6478f785a6d7e704777c86a7c6/9603?ref=0x079f2dA348Fc863FDc1A2B995B4796b8fAA25e48",
              "display_url": "opensea.io/assets/0x60e4d…"
            }
          ]
        },
        "lang": "en",
        "created_at": "2022-01-05T13:27:07.000Z"
      },
      {
        "id": "1478718082759680004",
        "author_id": "1388385126652944384",
        "text": "Bored Ape #5850 was purchased for 73.98 ETH \n https://t.co/jInpckgPq2",
        "entities": {
          "urls": [
            {
              "start": 46,
              "end": 69,
              "url": "https://t.co/jInpckgPq2",
              "expanded_url": "https://opensea.io/assets/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d/5850?ref=0x079f2dA348Fc863FDc1A2B995B4796b8fAA25e48",
              "display_url": "opensea.io/assets/0xbc4ca…",
              "images": [
                {
                  "url": "https://pbs.twimg.com/news_img/1478718086333321220/mo5DZJzo?format=png&name=orig",
                  "width": 631,
                  "height": 631
                },
                {
                  "url": "https://pbs.twimg.com/news_img/1478718086333321220/mo5DZJzo?format=png&name=150x150",
                  "width": 150,
                  "height": 150
                }
              ],
              "status": 200,
              "title": "5850 - Bored Ape Yacht Club | OpenSea",
              "description": "The Bored Ape Yacht Club is a collection of 10,000 unique Bored Ape NFTs— unique digital collectibles living on the Ethereum blockchain. Your Bored Ape doubles as your Yacht Club membership card, and grants access to members-only benefits, the first of which is access to THE BATHROOM, a collaborative graffiti board. Future areas and perks can be unlocked by the community through roadmap activation. Visit www.BoredApeYachtClub.com for more details.",
              "unwound_url": "https://opensea.io/assets/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d/5850?ref=0x079f2dA348Fc863FDc1A2B995B4796b8fAA25e48"
            }
          ]
        },
        "lang": "en",
        "created_at": "2022-01-05T13:20:38.000Z"
      },
      {
        "id": "1478716204307079169",
        "author_id": "1388385126652944384",
        "text": "Dog #5250 was purchased for 6.2 ETH \n https://t.co/l33HN6ZG9O",
        "entities": {
          "urls": [
            {
              "start": 38,
              "end": 61,
              "url": "https://t.co/l33HN6ZG9O",
              "expanded_url": "https://opensea.io/assets/0xba30e5f9bb24caa003e9f2f0497ad287fdf95623/5250?ref=0x079f2dA348Fc863FDc1A2B995B4796b8fAA25e48",
              "display_url": "opensea.io/assets/0xba30e…",
              "images": [
                {
                  "url": "https://pbs.twimg.com/news_img/1478716218001526786/aRyeFQUD?format=jpg&name=orig",
                  "width": 1262,
                  "height": 1262
                },
                {
                  "url": "https://pbs.twimg.com/news_img/1478716218001526786/aRyeFQUD?format=jpg&name=150x150",
                  "width": 150,
                  "height": 150
                }
              ],
              "status": 200,
              "title": "5250 - Bored Ape Kennel Club | OpenSea",
              "description": "It gets lonely in the swamp sometimes. That's why every ape should have a four-legged companion. To curl up at your feet. To bring you a beer. To fire a missile launcher at that bastard Jimmy the Monkey. That's why we've started the Bored Ape Kennel Club, and why we're offering up a dog NFT for adoption to every single member of the BAYC – for free (you only pay gas). Any royalties we accrue on secondary sales will be donated to charity. Learn more at: http://boredapeyachtclub.com/#/kennel-club",
              "unwound_url": "https://opensea.io/assets/0xba30e5f9bb24caa003e9f2f0497ad287fdf95623/5250?ref=0x079f2dA348Fc863FDc1A2B995B4796b8fAA25e48"
            }
          ]
        },
        "lang": "en",
        "created_at": "2022-01-05T13:13:10.000Z"
      }
    ],
    "meta": {
      "oldest_id": "1478716204307079169",
      "newest_id": "1478724068023095299",
      "result_count": 5,
      "next_token": "7140dibdnow9c7btw3z3q7scmh2zwwf1bm9w3nxs3kh15"
    }
  }

Another response might look like this:
Missing from entities[‘urls’] images,status,title,description and unwound_url

{
  "data": [
    {
      "text": "Bored Ape #4344 was purchased for 69.69 ETH \n https://t.co/gWnkcW8KsY",
      "lang": "en",
      "entities": {
        "urls": [
          {
            "start": 46,
            "end": 69,
            "url": "https://t.co/gWnkcW8KsY",
            "expanded_url": "https://opensea.io/assets/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d/4344?ref=0x079f2dA348Fc863FDc1A2B995B4796b8fAA25e48",
            "display_url": "opensea.io/assets/0xbc4ca…"
          }
        ]
      },
      "created_at": "2022-01-05T13:44:25.000Z",
      "author_id": "1388385126652944384",
      "id": "1478724068023095299"
    },
    {
      "text": "Mutant #1225 was purchased for 19.0 ETH \n https://t.co/3bSFeyQ0w8",
      "lang": "en",
      "entities": {
        "urls": [
          {
            "start": 42,
            "end": 65,
            "url": "https://t.co/3bSFeyQ0w8",
            "expanded_url": "https://opensea.io/assets/0x60e4d786628fea6478f785a6d7e704777c86a7c6/1225?ref=0x079f2dA348Fc863FDc1A2B995B4796b8fAA25e48",
            "display_url": "opensea.io/assets/0x60e4d…"
          }
        ]
      },
      "created_at": "2022-01-05T13:44:20.000Z",
      "author_id": "1388385126652944384",
      "id": "1478724045617209346"
    },
    {
      "text": "Mutant #9603 was purchased for 18.49 ETH \n https://t.co/tUbnTyH7sY",
      "lang": "en",
      "entities": {
        "urls": [
          {
            "start": 43,
            "end": 66,
            "url": "https://t.co/tUbnTyH7sY",
            "expanded_url": "https://opensea.io/assets/0x60e4d786628fea6478f785a6d7e704777c86a7c6/9603?ref=0x079f2dA348Fc863FDc1A2B995B4796b8fAA25e48",
            "display_url": "opensea.io/assets/0x60e4d…"
          }
        ]
      },
      "created_at": "2022-01-05T13:27:07.000Z",
      "author_id": "1388385126652944384",
      "id": "1478719714973134851"
    },
    {
      "text": "Bored Ape #5850 was purchased for 73.98 ETH \n https://t.co/jInpckgPq2",
      "lang": "en",
      "entities": {
        "urls": [
          {
            "start": 46,
            "end": 69,
            "url": "https://t.co/jInpckgPq2",
            "expanded_url": "https://opensea.io/assets/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d/5850?ref=0x079f2dA348Fc863FDc1A2B995B4796b8fAA25e48",
            "display_url": "opensea.io/assets/0xbc4ca…"
          }
        ]
      },
      "created_at": "2022-01-05T13:20:38.000Z",
      "author_id": "1388385126652944384",
      "id": "1478718082759680004"
    },
    {
      "text": "Dog #5250 was purchased for 6.2 ETH \n https://t.co/l33HN6ZG9O",
      "lang": "en",
      "entities": {
        "urls": [
          {
            "start": 38,
            "end": 61,
            "url": "https://t.co/l33HN6ZG9O",
            "expanded_url": "https://opensea.io/assets/0xba30e5f9bb24caa003e9f2f0497ad287fdf95623/5250?ref=0x079f2dA348Fc863FDc1A2B995B4796b8fAA25e48",
            "display_url": "opensea.io/assets/0xba30e…",
            "images": [
              {
                "url": "https://pbs.twimg.com/news_img/1478716218001526786/aRyeFQUD?format=jpg&name=orig",
                "width": 1262,
                "height": 1262
              },
              {
                "url": "https://pbs.twimg.com/news_img/1478716218001526786/aRyeFQUD?format=jpg&name=150x150",
                "width": 150,
                "height": 150
              }
            ],
            "status": 200,
            "title": "5250 - Bored Ape Kennel Club | OpenSea",
            "description": "It gets lonely in the swamp sometimes. That's why every ape should have a four-legged companion. To curl up at your feet. To bring you a beer. To fire a missile launcher at that bastard Jimmy the Monkey. That's why we've started the Bored Ape Kennel Club, and why we're offering up a dog NFT for adoption to every single member of the BAYC – for free (you only pay gas). Any royalties we accrue on secondary sales will be donated to charity. Learn more at: http://boredapeyachtclub.com/#/kennel-club",
            "unwound_url": "https://opensea.io/assets/0xba30e5f9bb24caa003e9f2f0497ad287fdf95623/5250?ref=0x079f2dA348Fc863FDc1A2B995B4796b8fAA25e48"
          }
        ]
      },
      "created_at": "2022-01-05T13:13:10.000Z",
      "author_id": "1388385126652944384",
      "id": "1478716204307079169"
    }
  ],
  "meta": {
    "oldest_id": "1478716204307079169",
    "newest_id": "1478724068023095299",
    "result_count": 5,
    "next_token": "7140dibdnow9c7btw3z3q7scmh2zwwf1bm9w3nxs3kh15"
  }
}

Can someone please save my sanity and point me in the right direction?
Thanks!

2 Likes

I’m having this same issue as well. More often than not, I don’t receive an unwound_url or any of the similar fields?

Like those shown as available here:

description, title, status, etc