Please need help with c# to search about hashtag?



**Please i’m new with twitter api - i need to search for hashtag using c# - i do many search but i can’t find any c# example show hoe it can be done **

**so please any way to know how i can search about hashtag to get it’s posts or users or engagement or impression **

i hope to find help here
thanks a lot …


There is a lot to unpack here, but I’ll try my best.

First off, I am not aware of any C# examples unfortunately. Hopefully someone else from the community can chime in with a good example, or if not, please do feel free to help contribute to the community!

If you are trying to search a hashtag or for specific posts and users attached to those posts, you can do so in either realtime or historically.
Historically - You are going to want to use the Search Tweets APIs. We have a lot of information in our documentation that should help you out.
Realtime - You are going to want to use our Filter Realtime Tweets APIs.

If you are trying to lookup a user’s information, you are going to want to use our either GET users/show or GET users/lookup.

While we do include some engagement data in our Tweet payloads, you can pull in-depth engagement metrics using our enterprise Engagement API.

Please let me know if you need anything else!


Hi Ahmed,
On the c# question. There are few libraries that you can use to get started:

I have only tried Twitterizer and it was super simple, though it hasn’t been updated for a while, so I am not sure if it still works.

If you are inclined to write your own code without a library, the API is very simple, you just make a call and pass parameters with HttpClient to be honest, the only tricky part is setting up oAuth in your requests.


** the only tricky part is setting up oAuth in your requests.

can you please provide me any sample code so i can know how to use it ?


Hi Ahmed,
If you are inclined to writing your own authentication code without a library, here is how to setup oAuth

I haven’t actually tried this code, but the logic looks very similar to what our code does.