{"id":13549409,"url":"https://github.com/leoafarias/pub_api_client","last_synced_at":"2025-05-15T14:07:26.321Z","repository":{"id":38741151,"uuid":"305393469","full_name":"leoafarias/pub_api_client","owner":"leoafarias","description":"The most complete \u0026 unofficial API Client for Dart Pub.dev","archived":false,"fork":false,"pushed_at":"2025-03-22T00:22:30.000Z","size":675,"stargazers_count":91,"open_issues_count":0,"forks_count":19,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T20:07:57.540Z","etag":null,"topics":["api","dart","flutter","pub"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/pub_api_client","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leoafarias.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-19T13:29:27.000Z","updated_at":"2025-03-22T00:22:34.000Z","dependencies_parsed_at":"2024-01-07T06:28:53.131Z","dependency_job_id":"36ac593f-b7fe-461c-b802-d110674b3c27","html_url":"https://github.com/leoafarias/pub_api_client","commit_stats":{"total_commits":151,"total_committers":10,"mean_commits":15.1,"dds":0.2715231788079471,"last_synced_commit":"a917968beb1cc153008444d7ed6e6c4ee4fa2a04"},"previous_names":["fluttertools/pub_api_client"],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leoafarias%2Fpub_api_client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leoafarias%2Fpub_api_client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leoafarias%2Fpub_api_client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leoafarias%2Fpub_api_client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leoafarias","download_url":"https://codeload.github.com/leoafarias/pub_api_client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254355335,"owners_count":22057354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","dart","flutter","pub"],"created_at":"2024-08-01T12:01:21.555Z","updated_at":"2025-05-15T14:07:21.308Z","avatar_url":"https://github.com/leoafarias.png","language":"Dart","readme":"\u003cimg src=\"https://github.com/leoafarias/pub_api_client/blob/main/assets/logo.png?raw=true\" alt=\"drawing\" width=\"320\"/\u003e\n\n[![Pub Version](https://img.shields.io/pub/v/pub_api_client?label=version\u0026style=flat-square)](https://pub.dev/packages/pub_api_client/changelog) ![Pub Likes](https://img.shields.io/pub/likes/pub_api_client?label=Pub%20Likes\u0026style=fflat-squaree)\n![Pub Points](https://img.shields.io/pub/points/pub_api_client?label=Pub%20Points\u0026style=fflat-squaree) [![Coverage Status](https://coveralls.io/repos/github/leoafarias/pub_api_client/badge.svg?branch=main)](https://coveralls.io/github/leoafarias/pub_api_client?branch=main) [![MIT Licence](https://img.shields.io/github/license/leoafarias/pub_api_client?style=flat-square\u0026longCache=true)](https://opensource.org/licenses/mit-license.php)\n\n## An unofficial API client for [Pub.dev](https://www.pub.dev)\n\nAims to be the most complete and stable pub.dev API client. If any particular endpoint is missing please [open an issue](https://github.com/leoafarias/pub_api_client/issues).\n\n## Table of contents\n\n- [Usage](#usage)\n- [API](#api)\n  - [Packages](#packages)\n    - [Details](#get-package-info)\n    - [Score](#get-package-score)\n    - [Metrics](#get-package-metrics)\n    - [Versions](#get-package-versions)\n    - [Version Info](#get-package-version-info)\n    - [Publisher](#get-package-publisher)\n    - [Options](#get-package-options)\n    - [Documentation](#get-documentation)\n  - [Search Packages](#search-packages)\n    - [Paging Search Results](#paging-search-results)\n  - [Like Packages](#like-packages)\n- [Utilities](#utilities)\n  - [Flutter Favorites](#flutter-favorites)\n  - [Google Packages](#google-packages)\n  - [Publisher Packages](#publisher-packages)\n  - [All Packages](#all-packages)\n\n## Usage\n\nA simple usage example:\n\n```dart\nimport 'package:pub_api_client/pub_api_client.dart';\n\nmain() {\n  final client =  PubClient();\n}\n```\n\n## API\n\n### Packages\n\n#### Get Package Info\n\nRetrieves all available information about an specific package.\n\n```dart\nfinal package =  await client.packageInfo('pkg_name');\n```\n\n#### Get Package Score\n\nReturns the following score information about a package.\n\n- Pub Points\n- Popularity\n- Likes\n\n```dart\nfinal score =  await client.packageScore('pkg_name');\n```\n\n#### Get Package Metrics\n\nThe method 'packageMetrics' returns the package 'score' together with a 'scorecard'\n\n```dart\nfinal metrics =  await client.packageMetrics('pkg_name');\n```\n\n#### Get Package Versions\n\nThe method 'packageVersions' also returns the versions. However if all you need is versions use this method since it's lighter.\n\n```dart\nfinal versions =  await client.packageVersions('pkg_name');\n```\n\n#### Get Package Version Info\n\nThe method `packageVersionInfo` returns information about a version of a specific package.\n\n```dart\nfinal version =  await client.packageVersionInfo('pkg_name', 'version');\n```\n\n#### Get Package Publisher\n\nThe method `packagePublisher` returns the publisherId of a specific package.\n\n```dart\nfinal publisher =  await client.packagePublisher('pkg_name');\n// publisher.publisherId\n```\n\n#### Get Package Options\n\nThe method `packageOptions` returns options of a package.\n\n```dart\nfinal options =  await client.packageOptions('pkg_name');\n```\n\n#### Get Documentation\n\nThe method `documentation` returns all versions and their respective documentation status.\n\n```dart\nfinal documentation =  await client.documentation('pkg_name');\n\n```\n\n### Like Packages\n\nAll requests for likes require pub.dev authentication.\n\n#### List liked packages\n\nDisplays list of of packages you have liked. Returns list of `packageLikes`\n\n```dart\nfinal likes =  await client.listPackageLikes();\n```\n\n#### Package Like Status\n\nReturns like status of a package.\n\n```dart\nfinal like =  await client.likePackageStatus();\n```\n\n#### Like a Package\n\nLikes a package. The method returns `packageLike` payload\n\n```dart\nfinal like =  await client.likePackage('pkg_name');\n```\n\n#### Unlike a Package\n\nUnlikes a package. The method returns `packageLike` payload\n\n```dart\nfinal like =  await client.unlikePackage('pkg_name');\n```\n\n### Search Packages\n\nSearch for packages on pub.dev. Will return the packages that match the query. You can filter the search with tags.\n\n```dart\nfinal results =  await client.search(\n  'query',\n  tags: [\n    PackageTag.publisher('publisher_id'),\n    PackageTag.dependency('dependency_name'),\n    'another:tag',\n  ],\n  topics:['topic_1', 'topic_2'],\n);\n// Returns the packages that match the query\nprint(results.packages)\n```\n\n#### Sorting search results\n\nYou are able to sort search results by the following:\n\n##### Top\n\nSearch score should be a weighted value of [text], [popularity], [points] and [like], ordered decreasing.\n\n##### Text\n\nSearch score should depend only on text match similarity, ordered decreasing.\n\n##### Created\n\nSearch order should be in decreasing last package creation time.\n\n##### Updated\n\nSearch order should be in decreasing last package updated time.\n\n##### Popularity\n\nSearch order should be in decreasing popularity score.\n\n##### Like\n\nSearch order should be in decreasing like count.\n\n##### Points\n\nSearch order should be in decreasing pub points.\n\n```dart\nfinal results =  await client.search('query', sort: SearchOrder.updated);\n\nprint(results.packages)\n```\n\n#### Paging Search Results\n\nYou are able to page search results.\n\n```dart\nfinal results =  await client.search('query');\nfinal nextPage = results.next;\nif (nextPage != null) {\n  final nextResults = await client.nextPage(nextPage);\n}\n\nprint(nextResults.packages)\n```\n\nIf you want to retrieve a specific result page you can call the `page` parameter directly.\n\n```dart\nfinal results =  await client.search('query',page:2);\nprint(results.packages)\n```\n\n## Utilities\n\n### Flutter Favorites\n\nReturns all Flutter favorites on pub.dev\n\n```dart\nfinal results = await client.fetchFlutterFavorites();\n```\n\n### Google Packages\n\nReturns all official Google packages. This will be a large payload with hundreds of packages.\n\n```dart\nfinal results = await client.fetchGooglePackages();\n```\n\n### Publisher Packages\n\nReturns all packages for a specific publisher\n\n```dart\n\nfinal results = await client.fetchPublisherPackages();\n```\n\n### All Packages\n\nReturns all packages that match a given query\n\n```dart\nfinal results = await fetchAllPackages('', tags: [PackageTag.publisher('leoafarias.com')])\n```\n","funding_links":[],"categories":["Dart"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleoafarias%2Fpub_api_client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleoafarias%2Fpub_api_client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleoafarias%2Fpub_api_client/lists"}