Search posts by a user
GET
/users/{user_id}/posts/search
users
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://trashnothing.com/api/v1.2/users//posts/search?search=&types=&sources='
Response Response Example
200 - Example 1
{
"end_index": 0,
"group_ids": [
"string"
],
"num_pages": 0,
"num_posts": 0,
"page": 0,
"per_page": 0,
"posts": [
{
"content": "Panasonic microwave oven in good working order 800 W power and turntable inside Has all the normal microwave functions plus grill elements for browning Comes with original instructions booklet It's an old microwave and could do with a bit of a clean, but still works very well\n",
"date": "2018-02-18T17:11:38",
"footer": null,
"group_id": 81,
"latitude": 42.961404,
"longitude": -88.012586,
"outcome": null,
"photos": null,
"post_id": 25997431,
"search_content": "Panasonic <span class=\"highlight\">microwave</span> oven in good working order 800 W power and turntable",
"search_title": "<span class=\"highlight\">Microwave</span> Oven (Greenfield)",
"title": "Microwave Oven (Greenfield)",
"type": "offer",
"user_id": 82928
}
],
"start_index": 0
}
Request
Path Params
user_id
string
required
Query Params
search
string
required
sort_by
string
optional
Relevance sorting will sort the posts that best match the search query first. Date sorting will sort posts from newest to oldest. Active sorting will sort active posts before satisfied, withdrawn and expired posts and then sort by date. Distance sorting will sort the closest posts first.
types
string
required
sources
string
required
NOTE: For requests using an api key instead of oauth, passing the trashnothing source or the open_archive_groups source makes the latitude, longitude and radius parameters required.
group_ids
string
optional
NOTE: For requests using an api key instead of oauth, this field is required if the 'groups' source is passed. In addition, only posts from groups that have open_archives set to true will be used (the group IDS of other groups will be silently discarded*).
*To determine which group IDs were used and which were discarded, use the group_ids field in the response.
per_page
integer
optional
The number of posts to return per page (must be >= 1 and <= 100).
page
integer
optional
device_pixel_ratio
number
optional
latitude
number
optional
longitude
number
optional
radius
number
optional
date_min
string
optional
date_max
string
optional
outcomes
string
optional
There are also a couple special values that can be passed. If set to an empty string (the default), only posts that are not satisfied and not withdrawn and not expired are returned. If set to 'all', all posts will be returned no matter what outcome the posts have.
Responses
Modified at 2022-09-11 18:59:48