Skip to main content

Search a Post

This endpoint performs search operation to posts

info

This operation requires authentication only if content_availability community option is false.

HTTP Request‚Äč

GET /api/v2/post/search/

Parameters‚Äč

NameInTypeRequiredDescription
searchquerystringfalseA search term.

Example Request‚Äč


const headers = {
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/post/search/',
{
method: 'GET',

headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

Responses‚Äč

Status Code 200

NameTypeRequiredRestrictionsDescription
¬Ľ countintegertruenoneTotal results count
¬Ľ nextstring¬¶nullfalsenoneNext page url
¬Ľ previousstring¬¶nullfalsenonePrevious page url
¬Ľ resultslist(SearchPost)truenoneList of results

Example responses‚Äč

{
"count": 123,
"next": "string",
"previous": "string",
"results": [
{
"id": 0,
"categories": [
{
"id": 0,
"tags": [],
"followed": false,
"order": 123,
"name": "string",
"name_synonyms": "string",
"slug": "string",
"slogan": "string",
"html_info": "string",
"seo_title": "string",
"seo_description": "string",
"auto_follow": "none",
"active": true,
"image_original": "string",
"image_bigger": "string",
"image_big": "string",
"image_medium": "string",
"image_small": "string",
"emotional_image_original": "string",
"emotional_image_position": 0,
"lastmod_datetime": "2019-08-24T14:15:22Z",
"stream_order_by": "recent",
"followers_counter": 13
}
],
"medias": [
{
"id": 0,
"added_at": "2019-08-24T14:15:22Z",
"type": "url",
"title": "string",
"description": "string",
"url": "https://example.com",
"image": "string",
"image_width": 0,
"image_height": 0,
"order": 0,
"embed": {
"id": 0,
"embed_type": "string",
"embed_id": "string",
"url": "string",
"metadata": {}
}
}
],
"location": {
"location": "string",
"lat": 0,
"lng": 0
},
"poll": {
"id": 0,
"title": "string",
"multiple_choices": true,
"added_at": "2019-08-24T14:15:22Z",
"modified_at": "2019-08-24T14:15:22Z",
"closed": true,
"expiration_at": "2019-08-24T14:15:22Z",
"hidden": "string",
"choices": [
{
"id": 0,
"choice": "string",
"order": 0,
"added_at": "2019-08-24T14:15:22Z",
"deleted": "string",
"vote_count": 0,
"voted": true
}
]
},
"last_activity_at": "2019-08-24T14:15:22Z",
"last_edited_at": null,
"author": {
"id": 0,
"username": "string",
"real_name": "string",
"date_joined": "2019-08-24T14:15:22Z",
"bio": "string",
"location": "string",
"location_lat_lng": "string",
"position_lat_lng": "string",
"date_of_birth": "string",
"description": "string",
"gender": "Male",
"website": "https://example.com",
"avatar": "string",
"cover": "string",
"ext_id": "string",
"tags": [],
"reputation": 111,
"followings_counter": 0,
"followers_counter": 0,
"posts_counter": 0,
"discussions_counter": 0,
"statuses_counter": 0,
"polls_counter": 0
},
"added_at": "2019-08-24T14:15:22Z",
"html": "string",
"summary": "string",
"deleted": true,
"collapsed": false,
"comment_count": 0,
"vote_count": 0,
"voted": false,
"followed": false,
"suspended": true,
"flag_count": 0,
"share_count": 0,
"addressing": [],
"matches": [
{
"object": {
"id": 238,
"type": "comment",
"added_at": "2020-10-19T16:05:34.974676+00:00",
"html": "string"
},
"author": {
"id": 0,
"username": "string",
"real_name": "string",
"date_joined": "2019-08-24T14:15:22Z",
"bio": "string",
"location": "string",
"location_lat_lng": "string",
"position_lat_lng": "string",
"date_of_birth": "string",
"description": "string",
"gender": "Male",
"website": "https://example.com",
"avatar": "string",
"cover": "string",
"ext_id": "string",
"tags": [],
"reputation": 111,
"followings_counter": 0,
"followers_counter": 0,
"posts_counter": 0,
"discussions_counter": 0,
"statuses_counter": 0,
"polls_counter": 0
}
}
]
}
]
}