Does anybody know of a Mastodon API for websites that lets me add a "Toot" button? Something like this from Twitter:

@mhall119 Nothing ready to use. But you can call To make it generic you need to have two input fields to add the Mastodon instance and the message someone want to send. I use it for share buttons on my blog, you can see it here if you scroll down: Code is here:

@bjoern Thanks Bjorn! Having to enter a mastodon instance isn't a great experience though, I couldn't actually remember which one I use :(

You could also have a drop down with the most common used instances. But that's the downside of decentralization, there is no central server for everyone. If you find a better solution I'm happy to hear about it but I fear there is none. :(

@bjoern But isn't the point of decentralization that you don't *need* a centralized server?

Couldn't I, in theory, tell that I want to post as @mhall119 and it would know that this account is registered with and either redirect me or use APIs to authenticate me?

How do you want to make sure that knows all instances and all users out there? Everybody can set up a instance at any time and/or register a user on any instance.

@mhall119 Mastodon has a custom url scheme that you can use. It's something like web+mastodon

@mhall119 It seems impossible because you, the Web page author, do not know the instance used by the Web page reader.

(And I think it is a bad idea, anyway. Sharing should be controlled by the user, for instance with )

@bortzmeyer Sharing would be controlled by the user, just allowing them to initiate the action and pre-populate text from the webpage

@mhall119 Actual "sharing" buttons do not leave control to the user. They are active Javascript and tell Facebook even before you click.

Sign in to participate in the conversation

Everyone is welcome as long as you follow our code of conduct! Thank you. is maintained by Sujitech, LLC.