twitter-context-annotations icon indicating copy to clipboard operation
twitter-context-annotations copied to clipboard

Search tweets or person by entity_id.

Open B0rner opened this issue 2 years ago • 4 comments

Is there a way to find tweets or users by entity_id using the twitter API v2?

B0rner avatar Jun 17 '22 09:06 B0rner

Use the context operator when performing a search query.

Example (from the page above) context:65.852262932607926273 will get all tweets from domain 65 (interest & hobbies) and entity 65.852262932607926273 (cats)

edvilme avatar Jul 17 '22 07:07 edvilme

Thank you. That sounds great and is working. Impartant hin in your example is: if taking the context from your csv file, I have to replac "," by "."

But how is the context syntax like this example from your file:

"131,166",1306568690641428481,$AMD context:"131.166".1306568690641428481,$AMD is not working.

B0rner avatar Sep 19 '22 09:09 B0rner

The entity from your example ($AMD) is related to two different domains (131 and 166), that's why the csv file shows "131,166" for that particular line.

If you want to get results from both domains, use (context:131.1306568690641428481 OR context:166.1306568690641428481).

I believe you can also use the entity operator with the string entity and just write entity:$AMD instead, but I've never tested this method and I'm not sure how it will behave with the $ sign.

Hope that helps!

omirete avatar Mar 13 '23 15:03 omirete

I've just tested it and you can pass entity:"$AMD" to make it work (note the double quotes wrapping the $AMD entity).

I'm guessing the issue can be closed now, if you agree.

omirete avatar Mar 13 '23 15:03 omirete