Back

Patreon API Essential Guide

Aug 2, 20246 minute read

What type of API does Patreon provide?

Based on the search results, Patreon uses a REST API. Here are the key points about Patreon's API:

API Type

Patreon uses a REST API. The documentation refers to REST concepts like resources, HTTP methods, and endpoints, which are characteristic of REST APIs.

Key Features

  • OAuth authentication - Patreon uses OAuth 2.0 for API authentication
  • JSON responses - The API returns data in JSON format
  • Resource-based - The API is structured around resources like users, campaigns, pledges, etc.
  • HTTP methods - Uses standard HTTP methods like GET, POST, etc.

API Access

  • Requires registering a client application to get API keys
  • Uses access tokens and refresh tokens for authentication
  • Has different scopes that can be requested for access

API Functionality

  • Allows fetching user profiles, campaign info, pledge data, etc.
  • Supports including related resources and specifying fields to return
  • Has a single endpoint structure typical of REST APIs

Best Practices

  • Recommends testing with dummy accounts
  • Encourages following accessibility guidelines when building apps
  • Provides client libraries in multiple languages like Python, JavaScript, Ruby, etc.

Does the Patreon API have webhooks?

Webhook Support

Yes, the official Patreon API does support webhooks.

Types of Events

The Patreon API currently supports webhooks for the following event types:

  • New patron (members:create)
  • Existing patron edits pledge (members:update)
  • Existing patron deletes pledge (members:delete)

Webhook Details

  • Webhooks allow you to receive real-time updates from Patreon's servers.
  • You can specify a URL for Patreon to send an HTTP POST to when one of the supported events occurs.
  • The POST request will contain the relevant data from the user action in JSON format.
  • The request will include headers with a message signature for verification.

Webhook Management

  • You can create, read, update, delete and list webhooks via the API (this feature is in beta).
  • You can view and manage your webhooks on the webhooks page in your Patreon account.

Webhook Behavior

  • Webhooks are not guaranteed to be sequential - they should be treated as asynchronous.
  • The webhook response format is consistent regardless of which event triggered it.
  • Different events trigger different webhooks (e.g. members:create for new members, members:update for changes to existing members).

Best Practices

  • It's recommended to use a combination of regular API polling and webhooks to keep your data in sync.
  • You should timestamp changes in your database and only apply webhook updates if they are more recent.

In summary, the Patreon API does offer webhook support for key events related to patrons and pledges, allowing developers to receive real-time updates for their integrations.

Rate Limits and other limitations

Based on the search results provided, here are the key points regarding the API Rate Limits of the Patreon API:

Current Rate Limiting Status

As of November 2017, Patreon did not have any specific rate limiting in place for their API. However, they mentioned that they were closely monitoring API usage to potentially implement "sensible yet strict limits" in the future.

While there were no hard limits at the time, a Patreon representative suggested the following:

  1. The initial limit of 1000 requests per day was considered too low for campaigns with a large number of pledges.

  2. A more sensible limit was suggested to be around 1000 requests per day, allowing for more flexibility.

Key Points to Consider

  1. Patreon was monitoring API usage and reserved the right to implement stricter limits in the future.

  2. For campaigns with many pledges, fetching all data could require multiple requests due to pagination.

  3. Patreon stated they would contact developers if they noticed excessive or inappropriate API usage.

  4. In extreme cases, Patreon mentioned they might disable the client or OAuth token causing issues.

Best Practices

  1. Implement reasonable self-imposed limits to avoid potential future restrictions.

  2. Be mindful of the number of requests needed for large campaigns and optimize accordingly.

  3. Stay updated with Patreon's developer documentation and announcements for any changes to rate limiting policies.

  4. Design your application to handle potential rate limiting gracefully, including implementing backoff strategies if needed.

It's important to note that this information is from 2017, and Patreon may have updated their API rate limiting policies since then. Developers should always refer to the most current official Patreon API documentation for the most up-to-date information on rate limits and best practices.

Latest API Version

Based on the search results provided, I could not find a specific mention of the most recent version number of the Patreon API. However, I can provide some relevant information about the Patreon API:

Key Points:

  1. The search results refer to the Patreon API documentation, which suggests there is an active API available for developers to use.

  2. The API documentation mentions both APIv1 and APIv2, indicating that there have been at least two major versions of the API.

  3. The documentation discusses differences between APIv1 and APIv2, suggesting that APIv2 is likely the more recent version.

API Features and Changes:

  • In APIv2, the Pledges resource has been replaced by the Members resource, which provides more data about the relationship between a patron and a creator.

  • APIv2 requires explicit requests for data attributes and relationships using the fields and include query parameters.

  • The scopes have been improved in APIv2 to provide better access for developers and enhanced security for users.

  • APIv2 allows developers to create webhooks on campaigns on behalf of the creator for real-time updates.

Best Practices:

  1. When using the API, make sure to request all required scopes.

  2. Keep your access tokens up to date. Tokens are valid for up to one month and can be refreshed using the provided methods.

  3. Follow accessibility best practices when building applications using the Patreon API.

While I cannot provide the exact version number of the most recent Patreon API, the information suggests that APIv2 is likely the current version. For the most up-to-date and accurate information, it would be best to check the official Patreon API documentation or contact their developer support directly.

How to get a Patreon developer account and API Keys?

  1. Create a Patreon creator account To use the Patreon API, you first need to create a Patreon creator account at patreon.com.

  2. Register your application Once you have a creator account, go to https://www.patreon.com/portal/registration/register-clients to register your application and get API credentials.

  3. Get your API credentials After registering, you'll receive:

  • Client ID
  • Client Secret
  • Creator's Access Token
  • Creator's Refresh Token

These are used to authenticate your application with the Patreon API.

  1. Set up OAuth Implement OAuth 2.0 in your application to allow users to log in with Patreon. This involves:
  • Creating a "Log in with Patreon" button
  • Handling the OAuth redirect
  • Validating the OAuth token
  • Using the token to make API calls
  1. Make API requests Use the Patreon API client libraries (available for Python, JavaScript, Ruby, PHP, Java) to make requests to the API endpoints.

  2. Test your integration You can test your integration by creating dummy Patreon accounts and pledges.

  3. Submit your integration If you want to get your app added to Patreon's app directory, follow their submission process.

What can you do with the Patreon API?

Based on the search results provided, here is a list of data models you can interact with using the Patreon API, along with what is possible for each:

User

  • Retrieve user information such as email, full name, about, created date, profile image URL, etc.
  • Access social connections data

Campaign

  • Get campaign details
  • Retrieve campaign goals

Member (replaces Pledges in APIv2)

  • Get detailed information about the relationship between a patron and a creator
  • Access charge status and membership lifetime data
  • Retrieve last charge date
  • Get currently entitled amount in cents
  • Access patron status (though exact values are not specified)

Tier

  • Retrieve tier information associated with members

Post

  • Access post attributes such as:
    • Title, content, URL
    • Published date
    • Whether it's paid or public
    • Associated tiers
    • Embed data and URL (if media is embedded)
    • App ID and status (if applicable)

Webhook

  • Create webhooks programmatically on behalf of creators
  • Subscribe to real-time updates about changes in a creator's patrons

Identity

  • Retrieve creator identity information

Key Points:

  • APIv2 requires explicitly requesting data attributes and relationships using fields and include query parameters
  • The API supports OAuth for authentication
  • Developers can now create apps for multiple creators without manual approval
  • There are new scopes to protect privacy and allow developers to request specific permissions
  • Rate limiting is not enforced during the beta period but will be implemented later

It's important to note that the API is still in beta, and some features or data models may change or be added in the future. Developers should refer to the official Patreon API documentation for the most up-to-date and comprehensive information.