I'm studying API access and I'm using the Github API. I want to make a screen in which it is possible to search by name the repositories that beat with the last criterion. But the results of Github are huge, how can I do to page this list?
Now I'm having trouble reading the JSON returned by the search. In the code below is the class that accesses the API and downloads JSON
public List<Repositorio> PesquisaRepo(string repoNome) {
List<Repositorio> repositorios = new List<Repositorio>();
string urlPesquisa = urlPesquisaRepo + repoNome;
var client = new WebClient();
client.Headers.Add("user-agent", this.userAgent);
var resposta = client.DownloadString(urlPesquisa);
var repoJSON = JArray.Parse(resposta);
}
At line var repoJSON = JArray.Parse(resposta);
the following error occurs:
Error reading JArray from JsonReader. Current JsonReader item is not an array
The returned JSON is in this format:
{
"total_count": 18551,
"incomplete_results": false,
"items": [
{
"id": 76954504,
"node_id": "MDEwOlJlcG9zaXRvcnk3Njk1NDUwNA==",
"name": "react-tetris",
"full_name": "chvin/react-tetris",
"owner": {
"login": "chvin",
"id": 5383506,
"node_id": "MDQ6VXNlcjUzODM1MDY=",
"avatar_url": "https://avatars2.githubusercontent.com/u/5383506?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/chvin",
"html_url": "https://github.com/chvin",
"followers_url": "https://api.github.com/users/chvin/followers",
"following_url": "https://api.github.com/users/chvin/following{/other_user}",
"gists_url": "https://api.github.com/users/chvin/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chvin/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chvin/subscriptions",
"organizations_url": "https://api.github.com/users/chvin/orgs",
"repos_url": "https://api.github.com/users/chvin/repos",
"events_url": "https://api.github.com/users/chvin/events{/privacy}",
"received_events_url": "https://api.github.com/users/chvin/received_events",
"type": "User",
"site_admin": false
How do I access only the "items" tag?
The URL I'm accessing is link