Skip to main content
REST API はバージョン管理になりました。 詳細については、「API のバージョン管理について」を参照してください。

フィード用 REST API エンドポイント

この REST API を使って、GitHub フィードを操作します。

GitHub フィードについて

Get feeds (フィードの取得) エンドポイントを使うと、その認証されたユーザーが使用できるすべてのフィードが一覧表示されます。 その後、いずれかのフィード URL に要求を送信して、フィードを取得できます。

既定で、タイムライン リソースは JSON 形式で返されます。 Accept ヘッダーで application/atom+xml の種類を指定することで、タイムライン リソースを Atom 形式で返すことができます。

要求の例

GitHub セキュリティ アドバイザリのフィードを Atom 形式で取得するには:

curl -H "Accept: application/atom+xml" https://github.com/security-advisories

応答の例

HTTP/2 200
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:media="http://search.yahoo.com/mrss/"
xml:lang="en-US">
  <id>tag:github.com,2008:/security-advisories</id>
  <link rel="self" type="application/atom+xml"
  href="https://github.com/security-advisories.atom"/>
  <title>GitHub Security Advisory Feed</title>
  <author>
    <name>GitHub</name>
  </author>
  <updated>2019-01-14T19:34:52Z</updated>
     <entry>
      <id>tag:github.com,2008:GHSA-abcd-12ab-23cd</id>
      <published>2018-07-26T15:14:52Z</published>
      <updated>2019-01-14T19:34:52Z</updated>
      <title type="html">[GHSA-abcd-12ab-23cd] Moderate
      severity vulnerability that affects Octoapp</title>
        <category term="NPM"/>
      <content type="html">
        &lt;p&gt;Octoapp node module before 4.17.5 suffers
        from a Modification of Assumed-Immutable Data (MAID)
        vulnerability via defaultsDeep, merge, and mergeWith
        functions, which allows a malicious user to modify
        the prototype of &quot;Object&quot; via
        &lt;strong&gt;proto&lt;/strong&gt;, causing the
        addition or modification of an existing property
        that will exist on all objects.&lt;/p&gt;
          &lt;p&gt;&lt;strong&gt;Affected Packages&lt;/strong&gt;&lt;/p&gt;

  &lt;dl&gt;
      &lt;dt&gt;Octoapp&lt;/dt&gt;
      &lt;dd&gt;Ecosystem: npm&lt;/dd&gt;
      &lt;dd&gt;Severity: moderate&lt;/dd&gt;
      &lt;dd&gt;Versions: &amp;lt; 4.17.5&lt;/dd&gt;
        &lt;dd&gt;Fixed in: 4.17.5&lt;/dd&gt;
  &lt;/dl&gt;

          &lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
      &lt;li&gt;https://nvd.nist.gov/vuln/detail/CVE-2018-123&lt;/li&gt;
  &lt;/ul&gt;

      </content>
    </entry>
</feed>

Get feeds

Lists the feeds available to the authenticated user. The response provides a URL for each feed. You can then get a specific feed by sending a request to one of the feed URLs.

  • Timeline: The GitHub global public timeline
  • User: The public timeline for any user, using uri_template. For more information, see "Hypermedia."
  • Current user public: The public timeline for the authenticated user
  • Current user: The private timeline for the authenticated user
  • Current user actor: The private timeline for activity created by the authenticated user
  • Current user organizations: The private timeline for the organizations the authenticated user is a member of.
  • Security advisories: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub.

By default, timeline resources are returned in JSON. You can specify the application/atom+xml type in the Accept header to return timeline resources in Atom format. For more information, see "Media types."

Note: Private feeds are only returned when authenticating via Basic Auth since current feed URIs use the older, non revocable auth tokens.

"Get feeds" のきめ細かいアクセス トークン

このエンドポイントは、次のトークンの種類で動作します:

トークンにはアクセス許可は必要ありません。

"Get feeds" の HTTP 応答状態コード

状態コード説明
200

OK

"Get feeds" のコード サンプル

要求の例

get/feeds
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/feeds

Response

Status: 200
{ "timeline_url": "https://github.com/timeline", "user_url": "https://github.com/{user}", "current_user_public_url": "https://github.com/octocat", "current_user_url": "https://github.com/octocat.private?token=abc123", "current_user_actor_url": "https://github.com/octocat.private.actor?token=abc123", "current_user_organization_url": "", "current_user_organization_urls": [ "https://github.com/organizations/github/octocat.private.atom?token=abc123" ], "security_advisories_url": "https://github.com/security-advisories", "_links": { "timeline": { "href": "https://github.com/timeline", "type": "application/atom+xml" }, "user": { "href": "https://github.com/{user}", "type": "application/atom+xml" }, "current_user_public": { "href": "https://github.com/octocat", "type": "application/atom+xml" }, "current_user": { "href": "https://github.com/octocat.private?token=abc123", "type": "application/atom+xml" }, "current_user_actor": { "href": "https://github.com/octocat.private.actor?token=abc123", "type": "application/atom+xml" }, "current_user_organization": { "href": "", "type": "" }, "current_user_organizations": [ { "href": "https://github.com/organizations/github/octocat.private.atom?token=abc123", "type": "application/atom+xml" } ], "security_advisories": { "href": "https://github.com/security-advisories", "type": "application/atom+xml" } } }