Search/tweets: searching urls brings back 0 results

rest
search

#1

Hi,
We try to bring back the recent results for a url using the search api but we keep getting 0 results even if we see recent results via the public search.
Here is the link:

Here is the search via the website bringing back recent results:
https://twitter.com/search?q=http%3A%2F%2Fwww.lemonde.fr%2Felections-americaines%2Farticle%2F2016%2F02%2F19%2Fle-ton-monte-entre-le-pape-francois-et-donald-trump_4868087_829254.html&src=typd

here is the api search done in ruby:

url = "http://www.lemonde.fr/elections-americaines/article/2016/02/19/le-ton-monte-entre-le-pape-francois-et-donald-trump_4868087_829254.html"
encoded_url = CGI::escape(url)
options = {result_type: "recent", lang: nil, count: 15}
@api = Twitter::Client.new(:oauth_token => token, :oauth_token_secret => secret)
@api.search(encoded_url, options)

We manage to get results on other urls but it seems like for some domain names we always get 0 results, for example:

we already know that the search api is not supposed to return all tweets but having always 0 results for these urls seems like an error.

Thank you in advance for you response.


#2

Hi there, this might be related. The API is giving less tweets, a lot less.


#3

Same here.

I regularly searched my website (toshimaru.net) on Twitter, but it suddenly didn’t return any results.

Other websites are properly shown on Twitter search, so I guess some URLs are blocked by Twitter for some reason?


#4

Hi,

I am Using Twitter search API.

endpoint : https://api.twitter.com/1.1/search/tweets.json?q={my_encoded_shortened_url}.

When I am using twitter search tool(https://twitter.com/search-home) to search any URL, it is searching and giving me matching tweets. But when I am making api call to above enpoint with bearer token. Its not giving me any results. And I made sure that the shared tweets are not 7 days older.

I have spent 3-4 days to figure out the solution but no luck so far. Please help.

Thanks


#5

Hi all,

How does it come there’s no solution on this topic yet? I’m currently experiencing the very same problem too. What is funny is that it does work when the tweets have been published from certain user accounts, whereas it doesn’t for others… I can find the targeted URL from Twitter home search but get no results at all when using the API.

Any clue will be really appreciated.


#6

Can you provide specific examples of queries you’re making?

Note that the standard search API does not index all Tweets.


#7

Hi @andypiper, thanks for your quick response. We have published a test url with JohnAppleSeedR account:
https://twitter.com/JohnAppIeseedR/status/1090612727133945856

And we can find this URL by searching on Twitter site:
https://twitter.com/search?f=tweets&q=https%3A%2F%2Fmymockurl.io%2Ffake%3Ffoo%3Dbar%26lorem%3Dipsum&src=typd

However, I’m getting 0 results when looking it up with either Standard tweet search or Premium sandbox:

curl -X GET \
  'https://api.twitter.com/1.1/search/tweets.json?q=https%3A//mymockurl.io/fake%3Ffoo%3Dbar%26lorem%3Dipsum'
  -H 'Authorization: Bearer myBearerToken
{
    "statuses": [],
    "search_metadata": {
        "completed_in": 0.013,
        "max_id": 1090614659286130689,
        "max_id_str": "1090614659286130689",
        "query": "https%3A%2F%2Fmymockurl.io%2Ffake%3Ffoo%3Dbar%26lorem%3Dipsum",
        "refresh_url": "?since_id=1090614659286130689&q=https%3A%2F%2Fmymockurl.io%2Ffake%3Ffoo%3Dbar%26lorem%3Dipsum&include_entities=1",
        "count": 15,
        "since_id": 0,
        "since_id_str": "0"
    }
}

curl -X POST \
  https://api.twitter.com/1.1/tweets/search/30day/dev.json \
  -H 'Authorization: Bearer myBearerToken \
  -d '{
	"query": "https%3A//mymockurl.io/fake%3Ffoo%3Dbar%26lorem%3Dipsum"
}'
{
    "results": [],
    "requestParameters": {
        "maxResults": 100,
        "fromDate": "201812310000",
        "toDate": "201901301425"
    }
}

Surprisingly, after tweeting with my account @jacmba, I get successful response with Standard search:

{
    "statuses": [
        {
            "created_at": "Wed Jan 30 14:32:31 +0000 2019",
            "id": 1090618767040745473,
            "id_str": "1090618767040745473",
            "text": "https://t.co/bZkZnCPbxu",
            "truncated": false,
            "entities": {
                "hashtags": [],
                "symbols": [],
                "user_mentions": [],
                "urls": [
                    {
                        "url": "https://t.co/bZkZnCPbxu",
                        "expanded_url": "https://mymockurl.io/fake?foo=bar&lorem=ipsum",
                        "display_url": "mymockurl.io/fake?foo=bar&l…",
                        "indices": [
                            0,
                            23
                        ]
                    }
                ]
            },
            "metadata": {
                "iso_language_code": "und",
                "result_type": "recent"
            },
            "source": "<a href=\"http://twitter.com\" rel=\"nofollow\">Twitter Web Client</a>",
            "in_reply_to_status_id": null,
            "in_reply_to_status_id_str": null,
            "in_reply_to_user_id": null,
            "in_reply_to_user_id_str": null,
            "in_reply_to_screen_name": null,
            "user": {
                "id": 218206652,
                "id_str": "218206652",
                "name": "Jacinto MC",
                "screen_name": "jacmba",
                "location": "Las Palmas",
                "description": "",
                "url": null,
                "entities": {
                    "description": {
                        "urls": []
                    }
                },
                "protected": false,
                "followers_count": 25,
                "friends_count": 70,
                "listed_count": 0,
                "created_at": "Sun Nov 21 18:31:08 +0000 2010",
                "favourites_count": 0,
                "utc_offset": null,
                "time_zone": null,
                "geo_enabled": true,
                "verified": false,
                "statuses_count": 181,
                "lang": "es",
                "contributors_enabled": false,
                "is_translator": false,
                "is_translation_enabled": false,
                "profile_background_color": "022330",
                "profile_background_image_url": "http://abs.twimg.com/images/themes/theme15/bg.png",
                "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme15/bg.png",
                "profile_background_tile": false,
                "profile_image_url": "http://pbs.twimg.com/profile_images/2426964435/DWY33ruP_normal",
                "profile_image_url_https": "https://pbs.twimg.com/profile_images/2426964435/DWY33ruP_normal",
                "profile_link_color": "0084B4",
                "profile_sidebar_border_color": "A8C7F7",
                "profile_sidebar_fill_color": "C0DFEC",
                "profile_text_color": "333333",
                "profile_use_background_image": true,
                "has_extended_profile": false,
                "default_profile": false,
                "default_profile_image": false,
                "following": null,
                "follow_request_sent": null,
                "notifications": null,
                "translator_type": "none"
            },
            "geo": null,
            "coordinates": null,
            "place": null,
            "contributors": null,
            "is_quote_status": false,
            "retweet_count": 0,
            "favorite_count": 0,
            "favorited": false,
            "retweeted": false,
            "possibly_sensitive": false,
            "lang": "und"
        }
    ],
    "search_metadata": {
        "completed_in": 0.029,
        "max_id": 1090618767040745473,
        "max_id_str": "1090618767040745473",
        "query": "https%3A%2F%2Fmymockurl.io%2Ffake%3Ffoo%3Dbar%26lorem%3Dipsum",
        "refresh_url": "?since_id=1090618767040745473&q=https%3A%2F%2Fmymockurl.io%2Ffake%3Ffoo%3Dbar%26lorem%3Dipsum&include_entities=1",
        "count": 15,
        "since_id": 0,
        "since_id_str": "0"
    }
}

#8

It looks like the other account is either not public, or the Tweet has been deleted, as I am unable to find it or click on those links now.