• <legend id='di1fZ'><style id='di1fZ'><dir id='di1fZ'><q id='di1fZ'></q></dir></style></legend>

      <bdo id='di1fZ'></bdo><ul id='di1fZ'></ul>
  • <i id='di1fZ'><tr id='di1fZ'><dt id='di1fZ'><q id='di1fZ'><span id='di1fZ'><b id='di1fZ'><form id='di1fZ'><ins id='di1fZ'></ins><ul id='di1fZ'></ul><sub id='di1fZ'></sub></form><legend id='di1fZ'></legend><bdo id='di1fZ'><pre id='di1fZ'><center id='di1fZ'></center></pre></bdo></b><th id='di1fZ'></th></span></q></dt></tr></i><div id='di1fZ'><tfoot id='di1fZ'></tfoot><dl id='di1fZ'><fieldset id='di1fZ'></fieldset></dl></div>

    1. <tfoot id='di1fZ'></tfoot>

        <small id='di1fZ'></small><noframes id='di1fZ'>

        Instagram 公共 API 的新 CORS 政策?

        时间:2023-10-14

        <small id='PSByt'></small><noframes id='PSByt'>

        <legend id='PSByt'><style id='PSByt'><dir id='PSByt'><q id='PSByt'></q></dir></style></legend>
        <tfoot id='PSByt'></tfoot>
        <i id='PSByt'><tr id='PSByt'><dt id='PSByt'><q id='PSByt'><span id='PSByt'><b id='PSByt'><form id='PSByt'><ins id='PSByt'></ins><ul id='PSByt'></ul><sub id='PSByt'></sub></form><legend id='PSByt'></legend><bdo id='PSByt'><pre id='PSByt'><center id='PSByt'></center></pre></bdo></b><th id='PSByt'></th></span></q></dt></tr></i><div id='PSByt'><tfoot id='PSByt'></tfoot><dl id='PSByt'><fieldset id='PSByt'></fieldset></dl></div>

          <tbody id='PSByt'></tbody>

                • <bdo id='PSByt'></bdo><ul id='PSByt'></ul>

                  本文介绍了Instagram 公共 API 的新 CORS 政策?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我将这些端点与 JavaScript Ajax 一起使用来获取 Instagram 用户信息和帖子:

                  https://www.instagram.com/[用户名]/?__a=1

                  https://www.instagram.com/graphql/query/?query_hash=472f257a40c653c64c666ce877d59d2b&variables={id:[user_id],first:50,after:''}

                  以前没有 CORS 策略错误,但现在我收到了该错误(不是每次刷新页面时,但几乎 95% 次):

                  CORS 政策已阻止从源https://sitename.com"访问https://www.instagram.com/hannahstocking/?__a=1"处的 XMLHttpRequest:无访问权限-请求的资源上存在 Control-Allow-Origin 标头.

                  Instagram 是否已开始阻止这些端点或添加了新的速率限制?我该如何解决?

                  解决方案

                  Instagram 引入了 strict-origin-when-cross-origin 政策,只允许以下跨源网站:p>

                  • https://www.instagram.com
                  • https://*.fbcdn.net
                  • https://*.instagram.com
                  • https://*.cdninstagram.com
                  • https://*.facebook.com
                  • https://*.fbsbx.com

                  这让我相信他们正在限制网站显示 API 数据.数据本身仍然可以访问,只是不能直接通过网站访问.您需要使用代理或服务器来解决它

                  I am using these endpoints with JavaScript Ajax to get Instagram user information and posts:

                  https://www.instagram.com/[username]/?__a=1

                  https://www.instagram.com/graphql/query/?query_hash=472f257a40c653c64c666ce877d59d2b&variables={id:[user_id],first:50,after:''}

                  There was not a CORS policy error before but now i'm getting that error (not every time when i refresh the page, but almost 95% times):

                  Access to XMLHttpRequest at 'https://www.instagram.com/hannahstocking/?__a=1' from origin 'https://sitename.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

                  Has Instagram started to block these endpoints or added a new rate limit? How can I fix it?

                  解决方案

                  Instagram has introduced a strict-origin-when-cross-origin policy and is only allowing the following cross origin sites:

                  • https://www.instagram.com
                  • https://*.fbcdn.net
                  • https://*.instagram.com
                  • https://*.cdninstagram.com
                  • https://*.facebook.com
                  • https://*.fbsbx.com

                  This leads me to believe that they are restricting websites to display the API data. The data itself is still accessible, just not directly over a website. You would need to use a proxy or a server to resolve it

                  这篇关于Instagram 公共 API 的新 CORS 政策?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:使用 Node.js 后端在我的 React 应用程序中启用 CO 下一篇:github oauth 上的 cors 问题

                  相关文章

                  最新文章

                  <i id='czTnw'><tr id='czTnw'><dt id='czTnw'><q id='czTnw'><span id='czTnw'><b id='czTnw'><form id='czTnw'><ins id='czTnw'></ins><ul id='czTnw'></ul><sub id='czTnw'></sub></form><legend id='czTnw'></legend><bdo id='czTnw'><pre id='czTnw'><center id='czTnw'></center></pre></bdo></b><th id='czTnw'></th></span></q></dt></tr></i><div id='czTnw'><tfoot id='czTnw'></tfoot><dl id='czTnw'><fieldset id='czTnw'></fieldset></dl></div>
                  • <bdo id='czTnw'></bdo><ul id='czTnw'></ul>
                • <tfoot id='czTnw'></tfoot>

                  1. <small id='czTnw'></small><noframes id='czTnw'>

                      <legend id='czTnw'><style id='czTnw'><dir id='czTnw'><q id='czTnw'></q></dir></style></legend>