Instagram远程服务器返回错误:(429)未知状态代码 [英] Instagram The remote server returned an error: (429) UNKNOWN STATUS CODE

查看:1086
本文介绍了Instagram远程服务器返回错误:(429)未知状态代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用自己的instagram API开发一些新程序. 除以下用户脚本外,一切正常 我想关注我的用户ID列表 所以我用这段代码

I'm working on some new programs using my own instagram api. Everything is working fine with me except following user script i wanna follow my list of users id so i use this code

        foreach (var item in listBox1.Items)
        {
            WebRequest request = WebRequest.Create("https://api.instagram.com/v1/users/"+item+"/relationship?access_token=" + Common.token2);
            request.Proxy = null;
            request.Method = "POST";
            string postData = "action=follow";
            byte[] byteArray = Encoding.UTF8.GetBytes(postData);
            // Set the ContentType property of the WebRequest.
            request.ContentType = "application/x-www-form-urlencoded";
            // Set the ContentLength property of the WebRequest.
            request.ContentLength = byteArray.Length;
            // Get the request stream.
            Stream dataStream = request.GetRequestStream();
            dataStream.Write(byteArray, 0, byteArray.Length);
            dataStream.Close();
            WebResponse response = request.GetResponse();
            // Display the status.
            MessageBox.Show(((HttpWebResponse)response).StatusDescription);
            dataStream.Close();
            response.Close();
            new System.Threading.Thread(GetInfo).Start();
            Thread.Sleep(TimeSpan.FromSeconds(2));
        }
        listBox1.Items.Clear();

它成功跟随前5个,然后返回

it follow first 5 successfully then it return with

远程服务器返回错误:(429)未知状态代码.

The remote server returned an error: (429) UNKNOWN STATUS CODE.

推荐答案

关注API调用每小时仅允许20个API调用.超过此限制后,您将收到429错误

The follow API call only allows 20 API calls/hour. After this limit, you will get 429 error

如果您执行已签名的呼叫,则每小时可以进行60次呼叫.

If you implement signed calls then you can do 60 calls/hour.

以下是限制的详细信息. https://instagram.com/developer/limits/

Here are details of the limits. https://instagram.com/developer/limits/

这篇关于Instagram远程服务器返回错误:(429)未知状态代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆