pub package package publisher API Wrapper for Dart

This wrapper lets you easily interact with the api.

  • Exposes all API types
  • Simple dart api
  • soon 100% API Coverage

Note: Before using this package you should read the Package Policies.


See example/example.dart

import 'package:crates_api/crates_api.dart';
import 'package:crates_api/types/v1/error.dart';

void main() async {
  var api = CratesAPI("crates_api.dart testing");

  var versionR = api.crate("diesel").version("2.0.2");

  try {
    var versionMetadata = await versionR.metadata();
    var versionDownloads = await versionR.downloads();
    var checksum = versionMetadata.checksum;
      "Checksum of diesel version 2.0.2 $checksum",

    var downloadEntry = versionDownloads[0];
    var entryVersion = downloadEntry.version;
    var entryDate =;
    var entryDownloads = downloadEntry.downloads;
        "Version $entryVersion was downloaded $entryDownloads times on $entryDate");
  } on APIException catch (e) {
    print( => e.detail));