Feature suggestion - acquire Patreon posts

Just want to point out that there are currently two different use-cases pointed out here so far:

  • Filmos wants to allow a creator to display their own posts on a website.
  • daemionfox wants to allow patrons to subscribe to a creator’s posts via RSS.

And to make things more complicated, I want to add a third:

  • I want to allow users (mainly myself) to easily and automatically save all their rewards locally.

Though for my use-case I’d also really want API access to messages as well, as most of the ephemeral content comes from there.

To be honest, it’s not in Patreon’s best interest to give us an RSS feed. It removes their ability to chain our content to their site. However we should keep asking for it. Or, find a service that provides it and use that instead.

Patreon’s interest is getting as much money running through it as possible, which means being the best option for creators and being appealing to as many patrons as possible so that they part with their money.

I don’t see how holding content hostage will lead to more money running through the platform. To the contrary, letting it off platform will almost certainly lead to a better patron experience, which means more patrons willing to dish out cash.

Could you give us an update? It’s been three months since your last one, and we’d still like an RSS feed for our Patreon posts.

It seems that some content are available through the published api. We stumbled on this while building a rss proxy for patreon and now get our text posts exposed in the feed. Could you describe more detailed what’s your use case and you might be able to either use our approach or our solution?

Personally, I got two different user cases for needing to acquire the patreon posts and their content.

Both are for a discord patreon integration via a discord bot.
First thing is the ability for non patreons to see the current poll and the vote tally of each option.
However with the recent changes my bot is now being served a 403 error when it tries to reach the /posts?include=Cpoll.choices%2Cpoll.current_user_responses.poll&filter[campaign_id]= api. This is both a valid user agent and without.
Which makes it so that the bot can’t automatically add any new polls that get added.
However, asking for a specific poll via the api still works.

The second use case is automatically posting the latest password to the patreon discord channel and pinning it for ease of access. This one requires /posts?sort=-published_at&filter[campaign_id]= to find the post with matching title. Same problem here now with the bot getting a 403 error on its requests.

Neither of these are possible as far as I can tell via the official api and thus needs the unofficial one instead.

Yes, for the poll I only can fetch the content, but not the options…

In the second case you can get the posts for a campaign like this:
https://www.patreon.com/api/oauth2/v2/campaigns/${campaignId}/posts?fields[post]=content,title,embed_data,embed_url,url,is_paid,is_public,published_at
… but maybe it doesn’t contain the field you need returned?

Has Paetron decided if they will open up the API to developers, or an RSS feed? I mean, this request has been open for almost 2 years at this point and there’s not been any progress we can see. What’s the status? Can we have an RSS feed? Could the API be expanded to retrieve posts? Bueller? Bueller?

I, also, would like to be able to access posts via API or RSS. I can’t imagine it requires a high level of engineering effort, by guess is the people on the business side don’t agree with the logic in this thread that it’s better for patreon to allow content to be pushed off their site

You may be able to make use of the posts endpoint at the API for accessing posts.

https://docs.patreon.com/#get-api-oauth2-v2-campaigns-campaign_id-posts

So, finally got around to trying this… No dice.

So, what you get out of the API v2 posts endpoint is this:

{
“data”:{
“attributes”:{},
“id”:“POSTID”,
“type”:“post”
},
“links”:{
“self”:“https://www.patreon.com/api/oauth2/v2/posts/POSTID
}
}

Which does not provide the post content that we’re looking for. In fact, it doesn’t provide any kind of content at all…

Are you people calling the v2 endpoint with a v2 creator token?

You must do that, and also include the fields you want with the call. Here is a working example:

https://www.patreon.com/api/oauth2/v2/posts/99999999?fields[post]=title,content,is_paid,is_public,published_at,url,embed_data,embed_url,app_id,app_status

Api v2 requires you have the correct scope (creator token has campaign.posts scope already) and that you require the fields and includes you want specifically.

Below you can find which fields you can ask while requesting the post:

https://docs.patreon.com/#post-v2

Okay, so. Yes, v2 endpoint with the v2 creator token. What was missing was the [post] after fields, which was not clear in the documentation.

However, it still did not work. I’m using the patreon/patreon ^1 composer library. Doing the request ends up with one of two errors depending on whether or not I run the URL through a urlencode.

Sending the following to the get_data method:

posts/99999999?fields[post]=title,content,is_paid,is_public,published_at,url,embed_data,embed_url,app_id,app_status

Without urlencode():
{
“errors”:[
{
“code”:1,
“code_name”:“Bad Request”,
“detail”:“Error trying to decode a non urlencoded string. Found invalid characters: {’[’, ‘]’} in the string: ‘fields[post]=title,content,is_paid,is_public,published_at,url,embed_data,embed_url,app_id,app_status’. Please ensure the request/response body is x-www-form-urlencoded.”,“id”:“40ac36eb-c95f-45ff-961a-3df198902955”,“status”:“400”,“title”:“Bad Request”
}
]
}

With urlencode():

{
“errors”:[
{
“code”:4,
“code_name”:“ResourceMissing”,
“detail”:“post with id 99999999?fields[post]=title,content,is_paid,is_public,published_at,url,embed_data,embed_url,app_id,app_status was not found.”,“id”:“02fab95f-665d-4bf1-8761-5b94ea14a697”,“status”:“404”,“title”:“post was not found.”
}
]
}

Yet, if I do the post without fields listed, I receive back a success, without data.

What was missing was the [post] after fields, which was not clear in the documentation.

Yes, having right scopes and having to request includes specifically became a thing with api v2, and it was explained in Api v2 documentation up above in documentation page. Its not repeated every time for every resource, so its a bit confusing.

posts/99999999?fields[post]=title,content,is_paid,is_public,published_at,url,embed_data,embed_url,app_id,app_status

Here, breaking the string and only encoding [ and ] could help.Rest of the url should not be urlencoded.

1 Like

Okay, so, that worked, but generally speaking, that is a terrible design. The composer library, published by Patreon, should not require us to URL Encode just the brackets for a pull from their API.

I’m calling this a win, but I’m also calling on developers to have some pride in their work and look at it from outside devs perspectives.

Code maintainability and API design should both follow the same guideline:

“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.” - John F. Woods

1 Like

Great to see that you got it to work.

We cannot accommodate the myriad of ways in which the users of this library or the applications which they may use this library to integrate with Patreon may form their urls or calls. Hence we have to leave that to the users of the library.

But, putting a note, informing people that they should be properly encoding their urls would definitely be a good idea. I’ll look into that.

So, next issue. Now that I’ve got my fix in place, how would I grab any attached media? The include field doesn’t seem to work with the /post API. But for an image post, the media is kind of important to have. So, thoughts?

Checking out documentation may help - the post info comes with embed info etc. You may try requesting the embed via the link that is returned in post info.

The embed data is returning as null, despite the fact there is an image attached to the post.

Array
(
    [attributes] => Array
        (
            [app_id] => 
            [app_status] => 
            [content] => <p>tea tea tea tea tea</p>
            [embed_data] => 
            [embed_url] => 
            [is_paid] => 
            [is_public] => 
            [published_at] => 2020-03-15T21:08:23.000+00:00
            [title] => Tea test
            [url] => /posts/tea-test-34******
        )

    [id] => 34******
    [type] => post
)
1 Like

Have you specifically requested embed data? Below is an example - its how WP plugin requests a post from Patreon.

https://www.patreon.com/api/oauth2/v2/campaigns?include=creator&fields[campaign]=created_at,creation_name,discord_server_id,image_small_url,image_url,is_charged_immediately,is_monthly,is_nsfw,main_video_embed,main_video_url,one_liner,one_liner,patron_count,pay_per_name,pledge_url,published_at,summary,thanks_embed,thanks_msg,thanks_video_url,has_rss,has_sent_rss_notify,rss_feed_title,rss_artwork_url,patron_count,discord_server_id,google_analytics_id&fields[user]=about,created,email,first_name,full_name,image_url,last_name,social_connections,thumb_url,url,vanity,is_email_verified

Also you may want to check it out by creating other test posts with embeds.