Developer Tools

Client Libraries and SDKs


Getting Started

To make it easy to build your Duffel integration, we offer client libraries in JavaScript, Python and Ruby. We'll be launching client libraries in other languages soon.

Node.js

If you're using JavaScript, first install the library using your favourite package manager:

Shell (using yarn)

yarn add @duffel/api
Then import it into your codebase and initialise it with your access token:

JavaScript

import { Duffel } from '@duffel/api'
const duffel = new Duffel({
token:
YOUR_ACCESS_TOKEN
,
})
View the repository on GitHub and check out the npm package:

Python

If you're using Python, first install the library using pip:

Python

pip install duffel-api
Then import it into your codebase and initialise it with your access token:

Python

from duffel_api import Duffel
duffel = Duffel(access_token=
$YOUR_ACCESS_TOKEN
)
View the repository on GitHub and check out the python package page:

Ruby

If you're using Ruby, first install the library using Bundler:

Ruby

gem add duffel_api
Then import it into your codebase and initialise it with your access token:

Ruby

require "duffel_api"
duffel = DuffelAPI::Client.new(access_token:
$YOUR_ACCESS_TOKEN
)
View the repository on GitHub and check out the ruby gem page:

C#

If you're using C#, first install the library using NuGet:

C#

Install-Package Duffel.ApiClient
Then import it into your codebase and initialise it with your access token:

C#

using Duffel.ApiClient;
var duffel = new DuffelApiClient(accessToken: $"{YOUR_ACCESS_TOKEN}", production: true);
View the repository on GitHub and check out the NuGet page: