Back to blog

Remember When Our API Sucked?

Remember When Our API Sucked?

Justin Hunter

OK, maybe sucked is too strong a word, but we definitely lost our way there for a bit. Our original API was purpose built to be as easy to use as possible. Our co-founder and CTO hated the complexity of a lot of the APIs he was using, and he wanted something that worked well for him. Turns out, it worked well for hundreds of thousands of other people. However, as we scaled and added features, we introduced unnecessary complexity and confusion.

Today, we’ve solved those problems and have returned to the simplicity and great developer experience Pinata has been known for.

Introducing the V3 Pinata API

Our V3 API includes all of the longstanding Pinata routes you’ve been using for years as well as our newer features in a single, RESTful interface that’s easy to use. You can read the docs here, but I’ll touch on the highlights.

  • Single API interface for all non-upload requests (api.pinata.cloud/v3/)
  • Single API interface for uploads (uploads.pinata.cloud/v3/)
  • Common pattern for request bodies
  • Common patter for response bodies
  • Faster
  • More scalable

The New Pinata SDK

Another benefit of the unified API is our new SDK. For those of you who experienced our SDK over the last 18 months, you’ve probably felt the pain of having to jump between either our public SDK (for public IPFS) or our private SDK (for private IPFS). That ends now.

npm i pinata@latest

This command will give you a unified Typescript SDK that handles public and private IPFS. It also has some nice features for uploads like automatic switching between resumable uploads and regular as well as routing between APIs for folder uploads vs. single file uploads.

This version of the SDK is by far the best and most developer-friendly version we’ve released to date. If you’re working in Typescript, we highly recommend you use this to improve your developer experience.

Uploads

The new API introduces significant gains in upload performance for single file uploads regardless of size. We will be rolling out similar gains for folder uploads soon.

If you’re uploading individual files, using the V3 API will get you better throughput and rate limits. For large files, we support the tus protocol and we have a proprietary implementation baked into the SDK if you don’t want to set up your own tus client.

What’s Next?

When we first decided to rebuild our API in Go, we knew it would be a long road. We also knew it’d be best to start with new features being built in the new API and migrate old endpoints over time. While this did cause some pain along the way, we’re excited to have everything unified.

We’ll be continuing to add new features to this API as well as improving uploads (including folder uploads) along the way.

Happy pinning!

Subscribe to paid plan image

Share this post:

Stay up to date

Join our newsletter for the latest stories & product updates from the Pinata community.