Botometer Pro

फ्रीमियम
द्वारा Observatory on Social Media | अपडेट किया गया il y a 14 jours | Social
लोकप्रियता

9.2 / 10

लेटेंसी

1,213ms

सेवा का स्तर

100%

Health Check

N/A

सभी चर्चाओं पर वापस जाएं

The remote server returned an error: (400) Bad Request.

Rapid account: Olivier Dellenbach
olivier.dellenbach
il y a 2 ans

Hi,
I am trying to use the lite botometer endpoint - I have subscribed to proper subscription plan.

Not sure to understand why I have this (400) error. I have properly extracted user profiles, created an array of 100 x { created_at / user } objects and passed it to the proper url.

See below my code (I have just replaced my api-key):
string postData = J.ToString();
ASCIIEncoding encoding = new ASCIIEncoding();
byte[] encodedPostData = encoding.GetBytes(postData);

            var req = WebRequest.Create($"https://botometer-pro.p.rapidapi.com/litev1/check_accounts_in_bulk");
            req.Method = "POST";
            req.Headers = new WebHeaderCollection() {
                { "x-rapidapi-key", "xxxxxxxxxxxx" },
                { "x-rapidapi-host", "botometer-pro.p.rapidapi.com" },
                };

            req.ContentType = "application/json";
            req.ContentLength = encodedPostData.Length;

            Stream stream = req.GetRequestStream();
            stream.Write(encodedPostData, 0, encodedPostData.Length);
            stream.Close();

            using (WebResponse res = req.GetResponse())
            {
                using (StreamReader sr = new StreamReader(res.GetResponseStream()))
                {
                    var properties = sr.ReadToEnd();
                    if (!string.IsNullOrEmpty(properties))
                    {
                        return JsonConvert.DeserializeObject(properties) as JArray;
                    }
                    else
                        return null;
                }
            }

Any help would be appreciated …

Thanks!

Rapid account: O So Me
OSoMe Commented il y a 2 ans

Sorry, I’m not familiar with JS. The 400 error suggests that the cause is incorrect payload format. But I can’t be sure based on the code you shared.

We would suggest using our botometer-python package to query the API (https://github.com/IUNetSci/botometer-python). Plus, RapidAPI also provides some example JS code snippets to query the API at https://rapidapi.com/OSoMe/api/botometer-pro , although we haven’t tested these snippets.

–Botometer Team

चर्चा में शामिल हों - नीचे टिप्पणी जोड़ें:

नई टिप्पणियाँ पोस्ट करने के लिए लॉग इन / साइनअप करें