Botometer Pro

부분 유료
분류별 Observatory on Social Media | 업데이트됨 5日前 | Social
인기

9.1 / 10

지연 시간

1,110ms

서비스 수준

100%

Health Check

N/A

모든 토론으로 돌아가기

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

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 2年前

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

아래에 의견을 추가하고 토론에 참여하세요.

새 댓글을 게시하려면 로그인 / 가입