marukot-chの日記

弱小SEの雑記です

You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints とTwitter APIに言われて泣いている君へ(どうでも記事)

日本語版(Japanese Ver.)

一応、日本語の記事の下に、英語版の記事もおいておきます(たまに外国人の方も見ている気がするので)。
In case you are interested, the English version of the article is below.

Twitter APIが使えない

v2のエンドポイント(例えばhttps://api.twitter.com/2/users/1)へアクセスすると、こんな感じになる。

{
    "client_id": "23359696",
    "detail": "When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer App that is attached to a Project. You can create a project via the developer portal.",
    "registration_url": "https://developer.twitter.com/en/docs/projects/overview",
    "title": "Client Forbidden",
    "required_enrollment": "Appropriate Level of API Access",
    "reason": "client-not-enrolled",
    "type": "https://api.twitter.com/2/problems/client-forbidden"
}

v1.1のエンドポイント(例えばhttps://api.twitter.com/1.1/favorites/list.json?user_id=1)にアクセスすると、こういうふうに言われる。

{
    "errors": [
        {
            "message": "You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints (e.g. media post, oauth) only. If you need access to this endpoint, you may need a different access level. You can learn more here: https://developer.twitter.com/en/portal/product",
            "code": 453
        }
    ]
}

それはv1.1やv2が前々から言われてる状況になったから!!!!!(2023年3月30日の記事より)

forest.watch.impress.co.jp

 「Standard」(v1.1)や「Essential」(v2)、「Elevated」(v2)、「Premium」といった既存のアクセスティアは今後30日以内に廃止されるとのことで、それまでに新しいものへ移行する必要がある。

とあったけれど、言われてから2023年6月なかばまで使えてたのは奇跡だったのかもしれない。
もうフリーで使えることしかできなくなってしまった...。

Twitter APIがフリーでできること

終わりに

TwitterAPIを適当に使わせてくれた時代は終わった。
今後どうなるかは神のみぞ知る...。(終り)

補足

  • Twitter APIを触っている人が読む前提で書いてます
  • Twitterログイン(Login with Twitter)とかだとまた別の話です(v2プロジェクトだと普通に使えたはず。Twitterの開発者コンソールを確認したら何がおこってるか分かると思いますが、利用者視点だと多分なんもわかんないです)

English Ver.

Twitter API is no longer available.

If you access a v2 endpoint (e.g. https://api.twitter.com/2/users/1), you will be got response something like this.

{
    "client_id": "23359696",
    "detail": "When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer App that is attached to a Project. You can create a project via the developer portal.",
    "registration_url": "https://developer.twitter.com/en/docs/projects/overview",
    "title": "Client Forbidden",
    "required_enrollment": "Appropriate Level of API Access",
    "reason": "client-not-enrolled",
    "type": "https://api.twitter.com/2/problems/client-forbidden"
}

If you access a v1.1 endpoint (e.g. https://api.twitter.com/1.1/favorites/list.json?user_id=1), you will be got response something like this.

{
    "errors": [
        {
            "message": "You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints (e.g. media post, oauth) only. If you need access to this endpoint, you may need a different access level. You can learn more here: https://developer.twitter.com/en/portal/product",
            "code": 453
        }
    ]
}

As twitter-dev previously explained, this is because the v1.1 and v2 access tiers have been discontinued.

https://twitter.com/TwitterDev/status/1641222786894135296?s=20

Over the next 30 days, we will deprecate current access tiers such as Standard (v1.1), Essential (v2), Elevated (v2), and Premium so we recommend that you migrate to the new tiers as soon as possible for a smooth transition.

It may have been a miracle that I was able to use them until the middle of June 2023.
It is no longer possible to do anything but use it for free....

What the Twitter API can do for free.

Conclusion

The days when Twitter let us use their API as we saw fit are over.
God only knows what will happen in the future... (End)