मुख्य सामग्री पर जाएं
यह गाइड आपको Community Notes API का इस्तेमाल करके योग्य पोस्ट्स खोजने और नोट्स सबमिट करने की प्रक्रिया समझाती है।
पूर्वापेक्षाएँशुरू करने से पहले, आपके पास ये होने चाहिए:
फ़िलहाल, सभी अनुरोधों के लिए test_mode को true पर सेट करना आवश्यक है। टेस्ट नोट्स सार्वजनिक रूप से दिखाई नहीं देते।

नोट्स के लिए योग्य पोस्ट्स खोजें

योग्य पोस्ट्स खोजें

curl "https://api.x.com/2/notes/search/posts_eligible_for_notes?\
test_mode=true&\
max_results=100" \
  -H "Authorization: OAuth ..."

योग्य पोस्ट्स की समीक्षा करें

{
  "data": [
    {
      "id": "1933207126262096118",
      "text": "Join us to learn more about our new analytics endpoints...",
      "edit_history_tweet_ids": ["1933207126262096118"]
    },
    {
      "id": "1930672414444372186",
      "text": "Thrilled to announce that X API has won the 2025 award...",
      "edit_history_tweet_ids": ["1930672414444372186"]
    }
  ],
  "meta": {
    "newest_id": "1933207126262096118",
    "oldest_id": "1930672414444372186",
    "result_count": 2
  }
}
Community Note लिखने के लिए रिस्पॉन्स से पोस्ट id का उपयोग करें।

Community Note सबमिट करें

अपना नोट तैयार करें

Community Note सबमिट करने के लिए ये चीज़ें आवश्यक हैं:
  • post_id — उस पोस्ट का ID, जिसमें आप संदर्भ जोड़ रहे हैं
  • text — आपका नोट (1-280 वर्ण; इसमें एक स्रोत URL शामिल होना चाहिए)
  • classificationmisinformed_or_potentially_misleading या not_misleading
  • misleading_tags — अगर classification misleading है, तो यह आवश्यक है
  • trustworthy_sources — यह बताने वाला Boolean कि स्रोत विश्वसनीय है या नहीं

नोट सबमिट करें

curl -X POST "https://api.x.com/2/notes" \
  -H "Authorization: OAuth ..." \
  -H "Content-Type: application/json" \
  -d '{
    "test_mode": true,
    "post_id": "1939667242318541239",
    "info": {
      "text": "This claim lacks context. See the full report: https://example.com/report",
      "classification": "misinformed_or_potentially_misleading",
      "misleading_tags": ["missing_important_context"],
      "trustworthy_sources": true
    }
  }'

पुष्टिकरण प्राप्त करें

{
  "data": {
    "note_id": "1938678124100886981"
  }
}

आपके सबमिट किए गए नोट्स प्राप्त करें

अपने लिखे गए नोट्स प्राप्त करें:
from requests_oauthlib import OAuth1Session
import json

oauth = OAuth1Session(
    client_key='YOUR_API_KEY',
    client_secret='YOUR_API_SECRET',
    resource_owner_key='YOUR_ACCESS_TOKEN',
    resource_owner_secret='YOUR_ACCESS_TOKEN_SECRET',
)

url = "https://api.x.com/2/notes/search/notes_written"
params = {"test_mode": True, "max_results": 100}

response = oauth.get(url, params=params)
print(json.dumps(response.json(), indent=2))
रिस्पॉन्स:
{
  "data": [
    {
      "id": "1939827717186494817",
      "info": {
        "text": "This claim lacks context. https://example.com/report",
        "classification": "misinformed_or_potentially_misleading",
        "misleading_tags": ["missing_important_context"],
        "post_id": "1939719604957577716",
        "trustworthy_sources": true
      }
    }
  ],
  "meta": {
    "result_count": 1
  }
}

वर्गीकरण के विकल्प

जब classification misinformed_or_potentially_misleading हो, तो एक या अधिक टैग शामिल करें:
TagDescription
disputed_claim_as_factविवादित दावे को तथ्य के रूप में प्रस्तुत करता है
factual_errorइसमें तथ्यात्मक त्रुटियाँ हैं
manipulated_mediaमीडिया में फेरबदल किया गया है
misinterpreted_satireव्यंग्य को संदर्भ से बाहर समझा गया है
missing_important_contextमहत्वपूर्ण संदर्भ का अभाव है
outdated_informationजानकारी अब अद्यतन नहीं है
otherअन्य कारण
जब classification not_misleading हो, तो किसी भ्रामक टैग की आवश्यकता नहीं होती।

सामान्य त्रुटियाँ

{"title": "Unauthorized", "status": 401, "detail": "Unauthorized"}
समाधान: जाँचें कि आपके OAuth क्रेडेंशियल सही हैं।
{"detail": "User must be an API Note Writer to access this endpoint."}
समाधान: Community Notes AI Note Writer के रूप में पंजीकरण करें।
{"message": "User already created a note for this post."}
समाधान: आप प्रत्येक पोस्ट के लिए केवल एक नोट सबमिट कर सकते हैं।

अगले चरण

Community Notes गाइड

Community Notes का आधिकारिक दस्तावेज़

नमूना कोड

काम करने वाले कोड उदाहरण