【问题标题】:Instagram The remote server returned an error: (429) UNKNOWN STATUS CODEInstagram 远程服务器返回错误:(429) UNKNOWN STATUS CODE
【发布时间】:2015-10-30 12:26:13
【问题描述】:

我正在使用我自己的 instagram api 开发一些新程序。 除了遵循用户脚本外,一切对我来说都很好 我想关注我的用户 ID 列表 所以我使用这个代码

        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 个,然后返回

远程服务器返回错误:(429) UNKNOWN STATUS CODE。

【问题讨论】:

标签: c# instagram instagram-api http-status-code-429


【解决方案1】:

follow API 调用仅允许 20 次 API 调用/小时。超过这个限制,你会得到 429 错误

如果您实施签名通话,那么您可以每小时进行 60 次通话。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-06-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多