trash nothing
  1. posts
trash nothing
  • messages
    • List conversations
      GET
    • Mark all conversations as read
      PUT
    • Search conversations
      GET
    • Delete conversation
      DELETE
    • Archive conversation
      PUT
    • Block conversation
      PUT
    • Mark conversation as read
      PUT
    • List conversation messages
      GET
    • Reply to conversation
      POST
    • Report conversation
      POST
    • Unarchive conversation
      PUT
    • Unblock conversation
      PUT
  • misc
    • Send feedback
  • groups
    • Search groups
    • Retrieve multiple groups
    • Join groups
    • Retrieve a group
    • Submit group answers
    • Contact group moderators
    • Leave a group
  • photos
    • Create a photo
    • Retrieve multiple photos
    • Delete a photo
    • Rotate a photo
  • posts
    • List posts
      GET
    • Submit a post
      POST
    • List all posts
      GET
    • List all post changes
      GET
    • Retrieve client.js
      GET
    • Retrieve multiple posts
      GET
    • Search posts
      GET
    • Retrieve a post
      GET
    • Update a post
      PUT
    • Delete a post bookmark
      DELETE
    • Bookmark a post
      PUT
    • Retrieve post display data
      GET
    • Flag a post
      POST
    • Map a post
      PUT
    • Promise an offer post
      PUT
    • Reply to a post
      POST
    • Satisfy a post
      PUT
    • Share a post
      POST
    • Unpromise an offer post
      PUT
    • Withdraw a post
      PUT
  • stories
    • List stories
    • Submit a story
    • Retrieve a story
    • Like a story
    • Unlike a story
    • Record story viewed
  • users
    • Retrieve current user
    • Update current user
    • List current users' email alerts
    • Create an email alert
    • Delete an email alert
    • Change email address
    • Set users' email address as not bouncing
    • List current users' groups
    • Update location
    • List current users' group notices
    • List current users' post locations
    • Save a post location for the current user
    • List current users' posts
    • Search current users' posts
    • Set a profile image
    • List current users' profile images
    • Resend account verification email
    • Send password reset email
    • Report a user
    • Retrieve a user
    • Retrieve user display info
    • Submit feedback on a user
    • List posts by a user
    • Search posts by a user
    • Retrieve a users' profile image
  1. posts

List all posts

GET
/posts/all
posts
This endpoint provides an easy way to get a feed of all the publicly published posts on trash nothing. It provides access to all publicly published offer and wanted posts from the last 30 days. The posts are sorted by date (newest first).

There are fewer options for filtering, sorting and searching posts with this endpoint but there is no 1,000 post limit and posts that are crossposted to multiple groups are not merged together in the response. In most cases, crossposted posts are easy to detect because they have the same user_id, title and content.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://trashnothing.com/api/v1.2/posts/all?types=&date_min=&date_max='
Response Response Example
200 - Example 1
{
    "posts": [
        {
            "content": "This ultrasonic diffuser creates an aroma in your home. It comes with two essential oils - mint and lavender.",
            "date": "2018-02-05T15:10:21",
            "footer": null,
            "group_id": 6,
            "latitude": 43.653226,
            "longitude": -79.383184,
            "outcome": "satisfied",
            "photos": [
                {
                    "images": [
                        {
                            "height": 120,
                            "url": "https://trashnothing.com/img/2018-02-05/cfsbfm-39051735845_379baab73f.90x120.jpg",
                            "width": 90
                        },
                        {
                            "height": 240,
                            "url": "https://trashnothing.com/img/2018-02-05/cfsbfm-39051735845_379baab73f.180x240.jpg",
                            "width": 180
                        },
                        {
                            "height": 360,
                            "url": "https://trashnothing.com/img/2018-02-05/cfsbfm-39051735845_379baab73f.270x360.jpg",
                            "width": 270
                        },
                        {
                            "height": 500,
                            "url": "https://trashnothing.com/img/2018-02-05/cfsbfm-39051735845_379baab73f.375x500.jpg",
                            "width": 375
                        }
                    ],
                    "photo_id": "695624-768616",
                    "thumbnail": "https://trashnothing.com/img/2018-02-05/cfsbfm-39051735845_379baab73f.90x120.jpg",
                    "url": "https://trashnothing.com/img/2018-02-05/cfsbfm-39051735845_379baab73f.375x500.jpg"
                }
            ],
            "post_id": 3171898,
            "title": "Ultrasonic diffuser (Downtown Toronto)",
            "type": "offer",
            "user_id": 2933
        }
    ]
}

Request

Query Params
types
string 
required
A comma separated list of the post types to return. The available post types are: offer, wanted
date_min
string 
required
Only posts newer than or equal to this UTC date and time will be returned. The UTC date and time used must be within a day or less of date_max. And the date and time must be within the last 30 days. And the date and time must be rounded to the nearest second.
date_max
string 
required
Only posts older than this UTC date and time will be returned. The UTC date and time used must be within a day or less of date_min. And the date and time must be rounded to the nearest second.
per_page
integer 
optional

The number of posts to return per page (must be >= 1 and <= 50).

page
integer 
optional
The page of posts to return.
device_pixel_ratio
number 
optional
Client device pixel ratio used to determine thumbnail size (default 1.0).

Responses

🟢200The posts.
application/json
Body
posts
array[object (Post) {15}] 
optional
content
string 
optional
date
string <date-time>
optional
The UTC date and time when the post was published.
expiration
string <date-time>
optional
The UTC date and time when the post will expire. Currently only offer and wanted posts expire. For all other posts, expiration is always null.
footer
string 
optional
Some groups add footers to posts that are separate and sometimes unrelated to the post itself - such as reminders about group rules or features (may be null).
group_id
string 
optional
The group ID of the post. For public posts, this is always null.
latitude
number 
optional
May be null if a post hasn't been mapped.
longitude
number 
optional
May be null if a post hasn't been mapped.
outcome
string 
optional
For offer and wanted posts, this indicates the outcome of the post which is null if no outcome has been set yet.

Offer post outcomes will be one of: satisfied, withdrawn, promised, expired

Wanted post outcomes will be one of: satisfied, withdrawn, expired

For all other posts, outcome is always null.
photos
array[object (Photo) {5}] 
optional
Details about the photos associated with this post (may be null if there are no photos).
post_id
string 
optional
source
string 
optional
The source of the post. One of: groups, trashnothing, open_archive_groups. A value of groups or open_archive_groups indicates the post is from a group and the group_id field will contain the ID of the group. A value of trashnothing indicates the post is a public post not associated with any group.
title
string 
optional
type
string 
optional
The type of post. One of: offer, taken, wanted, received, admin
url
string 
optional
The link to use to view the post on the trash nothing site.
user_id
string 
optional
🟠400Missing or invalid parameters.
Modified at 2022-09-11 18:59:48
Previous
Submit a post
Next
List all post changes
Built with