質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
JSON

JSON(JavaScript Object Notation)は軽量なデータ記述言語の1つである。構文はJavaScriptをベースとしていますが、JavaScriptに限定されたものではなく、様々なソフトウェアやプログラミング言語間におけるデータの受け渡しが行えるように設計されています。

REST

REST(Representational State Transfer)はwebアプリケーションの構築スタイルの一種です。HTTP GET/POSTによってリクエストを送信し、レスポンスはXMLで返されます。SOAPのようなRPCの構築と比べるとサーバからクライアントを分離することが出来る為、人気です。

URL

URL(ユニフォームリソースロケータ)とは、インターネット上のリソース(Webページや電子メールの宛先等)を特定するための形式的な記号の並びの事を言う。

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

Q&A

0回答

1095閲覧

github api を使って、特定のリポジトリを検索したい

kasai2_s_2_s

総合スコア8

JSON

JSON(JavaScript Object Notation)は軽量なデータ記述言語の1つである。構文はJavaScriptをベースとしていますが、JavaScriptに限定されたものではなく、様々なソフトウェアやプログラミング言語間におけるデータの受け渡しが行えるように設計されています。

REST

REST(Representational State Transfer)はwebアプリケーションの構築スタイルの一種です。HTTP GET/POSTによってリクエストを送信し、レスポンスはXMLで返されます。SOAPのようなRPCの構築と比べるとサーバからクライアントを分離することが出来る為、人気です。

URL

URL(ユニフォームリソースロケータ)とは、インターネット上のリソース(Webページや電子メールの宛先等)を特定するための形式的な記号の並びの事を言う。

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

0グッド

0クリップ

投稿2022/02/23 09:01

編集2022/02/23 09:30

実現したいこと

github apiのリポジトリを検索するAPIを使って、特定のリポジトリ情報をブラウザ上で取得したいです。

ブラウザ上で、
https://api.github.com/search/repositories?q=kotlin
と検索(qは検索クエリ)すると以下のように、items内に、検索クエリと合致するリポジトリが格納されて返されます。

検索結果を見てみると、"id" という項目があり、これが各リポジトリ固有の情報だと思われます。

今回実現したいことは、"id"のようなリポジトリ固有の情報をURL内で使用し、特定のリポジトリのみを返すようなURLの書き方が知りたいです。

例えば今回ならば、下記の検索結果にある、"id" = 3432266 というidを持つリポジトリのみを格納するitemsを、検索結果として返すURLの書き方が知りたいです。

どなたかお詳しい方、ご教授いただけると嬉しいです。

{ "total_count": 154669, "incomplete_results": true, "items": [ { "id": 3432266, "node_id": "MDEwOlJlcG9zaXRvcnkzNDMyMjY2", "name": "kotlin", "full_name": "JetBrains/kotlin", "private": false, "owner": { "login": "JetBrains", "id": 878437, "node_id": "MDEyOk9yZ2FuaXphdGlvbjg3ODQzNw==", "avatar_url": "https://avatars.githubusercontent.com/u/878437?v=4", "gravatar_id": "", "url": "https://api.github.com/users/JetBrains", "html_url": "https://github.com/JetBrains", "followers_url": "https://api.github.com/users/JetBrains/followers", "following_url": "https://api.github.com/users/JetBrains/following{/other_user}", "gists_url": "https://api.github.com/users/JetBrains/gists{/gist_id}", "starred_url": "https://api.github.com/users/JetBrains/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/JetBrains/subscriptions", "organizations_url": "https://api.github.com/users/JetBrains/orgs", "repos_url": "https://api.github.com/users/JetBrains/repos", "events_url": "https://api.github.com/users/JetBrains/events{/privacy}", "received_events_url": "https://api.github.com/users/JetBrains/received_events", "type": "Organization", "site_admin": false }, "html_url": "https://github.com/JetBrains/kotlin", "description": "The Kotlin Programming Language. ", "fork": false, "url": "https://api.github.com/repos/JetBrains/kotlin", "forks_url": "https://api.github.com/repos/JetBrains/kotlin/forks", "keys_url": "https://api.github.com/repos/JetBrains/kotlin/keys{/key_id}", "collaborators_url": "https://api.github.com/repos/JetBrains/kotlin/collaborators{/collaborator}", "teams_url": "https://api.github.com/repos/JetBrains/kotlin/teams", "hooks_url": "https://api.github.com/repos/JetBrains/kotlin/hooks", "issue_events_url": "https://api.github.com/repos/JetBrains/kotlin/issues/events{/number}", "events_url": "https://api.github.com/repos/JetBrains/kotlin/events", "assignees_url": "https://api.github.com/repos/JetBrains/kotlin/assignees{/user}", "branches_url": "https://api.github.com/repos/JetBrains/kotlin/branches{/branch}", "tags_url": "https://api.github.com/repos/JetBrains/kotlin/tags", "blobs_url": "https://api.github.com/repos/JetBrains/kotlin/git/blobs{/sha}", "git_tags_url": "https://api.github.com/repos/JetBrains/kotlin/git/tags{/sha}", "git_refs_url": "https://api.github.com/repos/JetBrains/kotlin/git/refs{/sha}", "trees_url": "https://api.github.com/repos/JetBrains/kotlin/git/trees{/sha}", "statuses_url": "https://api.github.com/repos/JetBrains/kotlin/statuses/{sha}", "languages_url": "https://api.github.com/repos/JetBrains/kotlin/languages", "stargazers_url": "https://api.github.com/repos/JetBrains/kotlin/stargazers", "contributors_url": "https://api.github.com/repos/JetBrains/kotlin/contributors", "subscribers_url": "https://api.github.com/repos/JetBrains/kotlin/subscribers", "subscription_url": "https://api.github.com/repos/JetBrains/kotlin/subscription", "commits_url": "https://api.github.com/repos/JetBrains/kotlin/commits{/sha}", "git_commits_url": "https://api.github.com/repos/JetBrains/kotlin/git/commits{/sha}", "comments_url": "https://api.github.com/repos/JetBrains/kotlin/comments{/number}", "issue_comment_url": "https://api.github.com/repos/JetBrains/kotlin/issues/comments{/number}", "contents_url": "https://api.github.com/repos/JetBrains/kotlin/contents/{+path}", "compare_url": "https://api.github.com/repos/JetBrains/kotlin/compare/{base}...{head}", "merges_url": "https://api.github.com/repos/JetBrains/kotlin/merges", "archive_url": "https://api.github.com/repos/JetBrains/kotlin/{archive_format}{/ref}", "downloads_url": "https://api.github.com/repos/JetBrains/kotlin/downloads", "issues_url": "https://api.github.com/repos/JetBrains/kotlin/issues{/number}", "pulls_url": "https://api.github.com/repos/JetBrains/kotlin/pulls{/number}", "milestones_url": "https://api.github.com/repos/JetBrains/kotlin/milestones{/number}", "notifications_url": "https://api.github.com/repos/JetBrains/kotlin/notifications{?since,all,participating}", "labels_url": "https://api.github.com/repos/JetBrains/kotlin/labels{/name}", "releases_url": "https://api.github.com/repos/JetBrains/kotlin/releases{/id}", "deployments_url": "https://api.github.com/repos/JetBrains/kotlin/deployments", "created_at": "2012-02-13T17:29:58Z", "updated_at": "2022-02-23T08:21:59Z", "pushed_at": "2022-02-23T06:45:34Z", "git_url": "git://github.com/JetBrains/kotlin.git", "ssh_url": "git@github.com:JetBrains/kotlin.git", "clone_url": "https://github.com/JetBrains/kotlin.git", "svn_url": "https://github.com/JetBrains/kotlin", "homepage": "https://kotlinlang.org", "size": 1400020, "stargazers_count": 40438, "watchers_count": 40438, "language": "Kotlin", "has_issues": false, "has_projects": false, "has_downloads": true, "has_wiki": false, "has_pages": false, "forks_count": 4980, "mirror_url": null, "archived": false, "disabled": false, "open_issues_count": 137, "license": null, "allow_forking": true, "is_template": false, "topics": [ "compiler", "gradle-plugin", "intellij-plugin", "kotlin", "kotlin-library", "maven-plugin", "programming-language" ], "visibility": "public", "forks": 4980, "open_issues": 137, "watchers": 40438, "default_branch": "master", "score": 1.0 }, 以下続く

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問