Create X Installation
curl --request POST \
--url https://apigcp.trynia.ai/v2/x/installations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"username": "<string>",
"bearer_token": "<string>",
"display_name": "<string>",
"max_results": 500,
"include_replies": false,
"include_retweets": false
}
'import requests
url = "https://apigcp.trynia.ai/v2/x/installations"
payload = {
"username": "<string>",
"bearer_token": "<string>",
"display_name": "<string>",
"max_results": 500,
"include_replies": False,
"include_retweets": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
username: '<string>',
bearer_token: '<string>',
display_name: '<string>',
max_results: 500,
include_replies: false,
include_retweets: false
})
};
fetch('https://apigcp.trynia.ai/v2/x/installations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apigcp.trynia.ai/v2/x/installations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'username' => '<string>',
'bearer_token' => '<string>',
'display_name' => '<string>',
'max_results' => 500,
'include_replies' => false,
'include_retweets' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apigcp.trynia.ai/v2/x/installations"
payload := strings.NewReader("{\n \"username\": \"<string>\",\n \"bearer_token\": \"<string>\",\n \"display_name\": \"<string>\",\n \"max_results\": 500,\n \"include_replies\": false,\n \"include_retweets\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apigcp.trynia.ai/v2/x/installations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"username\": \"<string>\",\n \"bearer_token\": \"<string>\",\n \"display_name\": \"<string>\",\n \"max_results\": 500,\n \"include_replies\": false,\n \"include_retweets\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apigcp.trynia.ai/v2/x/installations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"username\": \"<string>\",\n \"bearer_token\": \"<string>\",\n \"display_name\": \"<string>\",\n \"max_results\": 500,\n \"include_replies\": false,\n \"include_retweets\": false\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Usage
Create X Installation
POST
/
x
/
installations
Create X Installation
curl --request POST \
--url https://apigcp.trynia.ai/v2/x/installations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"username": "<string>",
"bearer_token": "<string>",
"display_name": "<string>",
"max_results": 500,
"include_replies": false,
"include_retweets": false
}
'import requests
url = "https://apigcp.trynia.ai/v2/x/installations"
payload = {
"username": "<string>",
"bearer_token": "<string>",
"display_name": "<string>",
"max_results": 500,
"include_replies": False,
"include_retweets": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
username: '<string>',
bearer_token: '<string>',
display_name: '<string>',
max_results: 500,
include_replies: false,
include_retweets: false
})
};
fetch('https://apigcp.trynia.ai/v2/x/installations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apigcp.trynia.ai/v2/x/installations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'username' => '<string>',
'bearer_token' => '<string>',
'display_name' => '<string>',
'max_results' => 500,
'include_replies' => false,
'include_retweets' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apigcp.trynia.ai/v2/x/installations"
payload := strings.NewReader("{\n \"username\": \"<string>\",\n \"bearer_token\": \"<string>\",\n \"display_name\": \"<string>\",\n \"max_results\": 500,\n \"include_replies\": false,\n \"include_retweets\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apigcp.trynia.ai/v2/x/installations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"username\": \"<string>\",\n \"bearer_token\": \"<string>\",\n \"display_name\": \"<string>\",\n \"max_results\": 500,\n \"include_replies\": false,\n \"include_retweets\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apigcp.trynia.ai/v2/x/installations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"username\": \"<string>\",\n \"bearer_token\": \"<string>\",\n \"display_name\": \"<string>\",\n \"max_results\": 500,\n \"include_replies\": false,\n \"include_retweets\": false\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
API key must be provided in the Authorization header
Body
application/json
X username to index (with or without @)
X API bearer token
Minimum string length:
10Optional custom display name for this source
Maximum string length:
120Maximum number of recent posts to index
Required range:
1 <= x <= 10000Whether replies should be indexed
Whether reposts/retweets should be indexed
Response
Successful Response
Was this page helpful?
⌘I

