Documentation Index
Fetch the complete documentation index at: https://generaltranslation.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
यह गाइड आपको पिछले 7 दिनों की पोस्ट्स ढूँढ़ने के लिए अपना पहला हालिया खोज अनुरोध करने में मार्गदर्शन देती है।
पूर्वापेक्षाएँशुरू करने से पहले, आपको इनकी आवश्यकता होगी:
- स्वीकृत ऐप के साथ एक डेवलपर खाता
- आपके ऐप का बेयरर टोकन (डेवलपर कंसोल में “Keys and tokens” के अंतर्गत उपलब्ध)
क्वेरी बनाएँ
खोज क्वेरियाँ पोस्ट्स से मिलान करने के लिए ऑपरेटर्स का उपयोग करती हैं। एक साधारण कीवर्ड से शुरू करें:या एक से अधिक ऑपरेटर मिलाकर इस्तेमाल करें:python lang:en -is:retweet
यह अंग्रेज़ी में “python” वाले पोस्ट्स से मेल खाता है और रीट्वीट्स को शामिल नहीं करता। अनुरोध भेजें
curl "https://api.x.com/2/tweets/search/recent?query=python%20lang%3Aen%20-is%3Aretweet" \
-H "Authorization: Bearer $BEARER_TOKEN"
रिस्पॉन्स की समीक्षा करें
डिफ़ॉल्ट रिस्पॉन्स में id, text, और edit_history_tweet_ids शामिल हैं:{
"data": [
{
"id": "1234567890123456789",
"text": "Just started learning Python and loving it!",
"edit_history_tweet_ids": ["1234567890123456789"]
},
{
"id": "1234567890123456788",
"text": "Python tip: use list comprehensions for cleaner code",
"edit_history_tweet_ids": ["1234567890123456788"]
}
],
"meta": {
"newest_id": "1234567890123456789",
"oldest_id": "1234567890123456788",
"result_count": 2
}
}
फ़ील्ड्स और expansions जोड़ें
क्वेरी पैरामीटर के साथ अतिरिक्त डेटा का अनुरोध करें:curl "https://api.x.com/2/tweets/search/recent?\
query=python%20lang%3Aen%20-is%3Aretweet&\
tweet.fields=created_at,public_metrics,author_id&\
expansions=author_id&\
user.fields=username,verified&\
max_results=10" \
-H "Authorization: Bearer $BEARER_TOKEN"
रिस्पॉन्स:{
"data": [
{
"id": "1234567890123456789",
"text": "Just started learning Python and loving it!",
"created_at": "2024-01-15T10:30:00.000Z",
"author_id": "9876543210",
"public_metrics": {
"retweet_count": 5,
"reply_count": 2,
"like_count": 42,
"quote_count": 1
},
"edit_history_tweet_ids": ["1234567890123456789"]
}
],
"includes": {
"users": [
{
"id": "9876543210",
"username": "pythondev",
"verified": false
}
]
},
"meta": {
"newest_id": "1234567890123456789",
"oldest_id": "1234567890123456789",
"result_count": 1
}
}
परिणामों को पृष्ठों में प्राप्त करें
SDKs पेजिनेशन को अपने-आप संभालते हैं। cURL के लिए, रिस्पॉन्स से next_token का उपयोग करें:curl "https://api.x.com/2/tweets/search/recent?\
query=python&\
max_results=100&\
next_token=b26v89c19zqg8o3fo7gesq314yb9l2l4ptqy" \
-H "Authorization: Bearer $BEARER_TOKEN"
पेजिनेशन मार्गदर्शिका
बड़े परिणाम सेटों में नेविगेट करने के बारे में और जानें
किसी खास उपयोगकर्ता की पोस्ट्स
"machine learning" has:images lang:en
किसी उपयोगकर्ता का उल्लेख करने वाली पोस्ट्स
किसी डोमेन के लिंक वाली पोस्ट्स
क्वेरी बनाएं
क्वेरी सिंटैक्स और ऑपरेटरों में दक्षता प्राप्त करें
ऑपरेटर संदर्भ
सभी उपलब्ध ऑपरेटर देखें
पूर्ण आर्काइव खोज
पूरे पोस्ट आर्काइव में खोजें
API संदर्भ
एंडपॉइंट का पूरा दस्तावेज़ीकरण