Skip to main content

Overview

Ayrshare’s Social-Post-API PyPI Package allows you to integrate the Ayrshare API into your Python app.

Installation

Install the Social-Post-API PyPI Package if you use Python on the server-side. The package simplifies the calls by wrapping the RESTful calls. Start by getting your secret API Key in Ayrshare Dashboard. Next, install the Python package:

General Usage

Examples of Post, History, and Delete. Please see the PyPI Package for more information.
Posting to X/Twitter? As of March 31, 2026, X/Twitter operations through Ayrshare require your own X Developer App credentials — Ayrshare enforces this on every X-bound call. Add the 2 BYO headers to your request. See the setup guide for details.
As of v1.3.0 the SDK includes a set_twitter_byo(api_key, api_secret) helper that attaches the two required X-Twitter-OAuth1-* headers to every subsequent request:
Use clear_twitter_byo() to drop the headers — useful when reusing one SDK instance across tenants:

Profile Key

You may specify the Profile Key for User Profile in the body of a POST or query of a GET with the profileKey field.

More Information and Documentation