curl --request GET \
--url https://our-secret-api-url.com/postimport requests
url = "https://our-secret-api-url.com/post"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://our-secret-api-url.com/post', 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://our-secret-api-url.com/post",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://our-secret-api-url.com/post"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://our-secret-api-url.com/post")
.asString();require 'uri'
require 'net/http'
url = URI("https://our-secret-api-url.com/post")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": 123,
"snowflakeId": "<string>",
"user": {
"id": 123,
"username": "<string>",
"bio": "<string>",
"name": "<string>",
"image": "<string>",
"verifiedAt": "2023-11-07T05:31:56Z"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"type": "post",
"hashtags": [
"<string>"
],
"content": "<string>",
"media": [
{
"id": 123,
"mediaUrl": "<string>",
"mimeType": "<string>",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"repliesCount": 123,
"replies": "<array>",
"originalId": 123,
"parentId": 123,
"parent": "<unknown>",
"repostsCount": 123,
"reposts": [
123
],
"isSuspended": true,
"links": [
{
"url": "<string>",
"title": "<string>",
"description": "<string>",
"image": "<string>"
}
]
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}Get Post
Retrieve a post by its Snowflake ID and username
curl --request GET \
--url https://our-secret-api-url.com/postimport requests
url = "https://our-secret-api-url.com/post"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://our-secret-api-url.com/post', 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://our-secret-api-url.com/post",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://our-secret-api-url.com/post"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://our-secret-api-url.com/post")
.asString();require 'uri'
require 'net/http'
url = URI("https://our-secret-api-url.com/post")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": 123,
"snowflakeId": "<string>",
"user": {
"id": 123,
"username": "<string>",
"bio": "<string>",
"name": "<string>",
"image": "<string>",
"verifiedAt": "2023-11-07T05:31:56Z"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"type": "post",
"hashtags": [
"<string>"
],
"content": "<string>",
"media": [
{
"id": 123,
"mediaUrl": "<string>",
"mimeType": "<string>",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"repliesCount": 123,
"replies": "<array>",
"originalId": 123,
"parentId": 123,
"parent": "<unknown>",
"repostsCount": 123,
"reposts": [
123
],
"isSuspended": true,
"links": [
{
"url": "<string>",
"title": "<string>",
"description": "<string>",
"image": "<string>"
}
]
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}Query Parameters
The ID of the post to retrieve
Username of the post owner
Response
Successful response with post data
ID of the post
Snowflake ID of the post
User who created the post
Show child attributes
Show child attributes
Creation timestamp of the post
Last update timestamp of the post
Type of the post
post, quote, repost List of hashtags associated with the post without the hashtag symbol (#), e.g. ['viral']
Content of the post
List of media items associated with the post
Show child attributes
Show child attributes
Number of replies to the post
List of replies to the post
ID of the original post if this is a reply, repost & quote repost
ID of the parent post if applicable
Parent post if applicable
Show child attributes
Show child attributes
Number of reposts of the post
List of userIds reposted
A boolean if the post/reply is suspended or not
List of OpenGraph details associated with the media
Show child attributes
Show child attributes
