history
Get the history of a post or all posts.
Click the β€Ί in the endpoint to view details.
get
https://app.ayrshare.com/api
/history
List History of Posts

Request Examples

cURL
Node.js
Python
PHP
C#
1
curl \
2
-H "Authorization: Bearer API_KEY" \
3
-X GET https://app.ayrshare.com/api/history
Copied!
1
const fetch = require("node-fetch");
2
const API_KEY = "API_KEY";
3
​
4
fetch("https://app.ayrshare.com/api/history", {
5
method: "GET",
6
headers: {
7
"Authorization": `Bearer ${API_KEY}`
8
}
9
})
10
.then((res) => res.json())
11
.then((json) => console.log(json))
12
.catch(console.error);
Copied!
1
import requests
2
​
3
headers = {'Authorization': 'Bearer API_KEY'}
4
​
5
r = requests.get('https://app.ayrshare.com/api/history', headers=headers)
6
7
print(r.json())
Copied!
1
<?php
2
require 'vendor/autoload.php'; // Composer auto-loader
3
​
4
$client = new GuzzleHttp\Client();
5
$res = $client->request(
6
'GET',
7
'https://app.ayrshare.com/api/history',
8
[
9
'headers' => [
10
'Content-Type' => 'application/json',
11
'Authorization' => 'Bearer API_KEY'
12
]
13
]
14
);
15
​
16
echo json_encode(json_decode($res->getBody()), JSON_PRETTY_PRINT);
Copied!
1
using System;
2
using System.Net;
3
using System.IO;
4
​
5
namespace HistoryGETRequest_charp
6
{
7
class History
8
{
9
static void Main(string[] args)
10
{
11
string API_KEY = "API_KEY";
12
string url = "https://app.ayrshare.com/api/history";
13
​
14
var httpWebRequest = WebRequest.CreateHttp(url);
15
httpWebRequest.ContentType = "application/json";
16
httpWebRequest.Headers.Add("Authorization", "Bearer " + API_KEY);
17
​
18
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
19
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
20
{
21
var response = streamReader.ReadToEnd();
22
Console.WriteLine(response);
23
}
24
}
25
}
26
}
Copied!
​
get
https://app.ayrshare.com/api
/history/:id
Get History by ID

Request Examples

cURL
Node.js
Python
PHP
C#
1
curl \
2
-H "Authorization: Bearer API_KEY" \
3
-X GET https://app.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl
Copied!
1
const fetch = require("node-fetch");
2
const API_KEY = "API_KEY";
3
​
4
fetch("https://app.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl", {
5
method: "GET",
6
headers: {
7
"Authorization": `Bearer ${API_KEY}`
8
}
9
})
10
.then((res) => res.json())
11
.then((json) => console.log(json))
12
.catch(console.error);
Copied!
1
import requests
2
​
3
headers = {'Authorization': 'Bearer API_KEY'}
4
​
5
r = requests.get('https://app.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl', headers=headers)
6
7
print(r.json())
Copied!
1
<?php
2
require 'vendor/autoload.php'; // Composer auto-loader
3
​
4
$client = new GuzzleHttp\Client();
5
$res = $client->request(
6
'GET',
7
'https://app.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl',
8
[
9
'headers' => [
10
'Content-Type' => 'application/json',
11
'Authorization' => 'Bearer API_KEY'
12
]
13
]
14
);
15
​
16
echo json_encode(json_decode($res->getBody()), JSON_PRETTY_PRINT);
Copied!
1
using System;
2
using System.Net;
3
using System.IO;
4
​
5
namespace HistoryGETRequest_charp
6
{
7
class History
8
{
9
static void Main(string[] args)
10
{
11
string API_KEY = "API_KEY";
12
string url = "https://app.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl";
13
​
14
var httpWebRequest = WebRequest.CreateHttp(url);
15
httpWebRequest.ContentType = "application/json";
16
httpWebRequest.Headers.Add("Authorization", "Bearer " + API_KEY);
17
​
18
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
19
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
20
{
21
var response = streamReader.ReadToEnd();
22
Console.WriteLine(response);
23
}
24
}
25
}
26
}
Copied!
​
get
https://app.ayrshare.com
/history/instagram
Get Instagram Past Posts
cURL
Node.js
Python
PHP
C#
1
curl \
2
-H "Authorization: Bearer API_KEY" \
3
-X GET https://app.ayrshare.com/api/history/instagram
Copied!
1
const fetch = require("node-fetch");
2
const API_KEY = "API_KEY";
3
​
4
fetch("https://app.ayrshare.com/api/history/instagram", {
5
method: "GET",
6
headers: {
7
"Authorization": `Bearer ${API_KEY}`
8
}
9
})
10
.then((res) => res.json())
11
.then((json) => console.log(json))
12
.catch(console.error);
Copied!
1
import requests
2
​
3
headers = {'Authorization': 'Bearer API_KEY'}
4
​
5
r = requests.get('https://app.ayrshare.com/api/history/instagram', headers=headers)
6
7
print(r.json())
Copied!
1
<?php
2
require 'vendor/autoload.php'; // Composer auto-loader
3
​
4
$client = new GuzzleHttp\Client();
5
$res = $client->request(
6
'GET',
7
'https://app.ayrshare.com/api/history/instagram',
8
[
9
'headers' => [
10
'Content-Type' => 'application/json',
11
'Authorization' => 'Bearer API_KEY'
12
]
13
]
14
);
15
​
16
echo json_encode(json_decode($res->getBody()), JSON_PRETTY_PRINT);
Copied!
1
using System;
2
using System.Net;
3
using System.IO;
4
​
5
namespace HistoryGETRequest_charp
6
{
7
class History
8
{
9
static void Main(string[] args)
10
{
11
string API_KEY = "API_KEY";
12
string url = "https://app.ayrshare.com/api/history/TBEAAqAMMJoweA9wKHUl";
13
​
14
var httpWebRequest = WebRequest.CreateHttp(url);
15
httpWebRequest.ContentType = "application/json";
16
httpWebRequest.Headers.Add("Authorization", "Bearer " + API_KEY);
17
​
18
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
19
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
20
{
21
var response = streamReader.ReadToEnd();
22
Console.WriteLine(response);
23
}
24
}
25
}
26
}
Copied!

Profiles

Get history data for a particular user profile by passing the profileKey parameter as a path parameter.
Available for Business Plan users only.
1
https://app.ayrshare.com/api/history?profileKey=ldfnk0s82j
Copied!
Last modified 12d ago