Data Types

The Publish API has data types which include standard primitives, basic types, and custom objects. Some API inputs are optional, while others are required.

The following are the primitive types supported in the API:

  • Float - a signed 32-bit integer, represented directly as a number in JSON payloads. In the documentation below, this is represented as float
  • String - a double-quote delineated string. In the documentation below, this is represented as string

The following are basic scalar types specific to the Displaying Content APIs:

  • body_text - a string representing the body in a post. This field cannot be longer than 8,192 bytes/characters.

  • hashtag - a string representing a hashtag in a post. This field cannot contain spaces.

  • media_attachments - a list of strings representing URLs for media attachments in a post. The maximum amount of attachments is 10.

Here is a list of the supported types:

Images: ('.gif', '.jpe', '.jpg', '.jpeg', '.png', '.tif', '.tiff', '.webp')
Videos: ('.mov', '.avi', '.mpg', '.mpeg', '.mp4', '.m4v')

The max file size for photos is 10MB per photo and the max file size for videos is 500MB per video. We do auto resize images and videos to fit the newsfeed. We also "center" the photo preview so that it displays the focus of the photo.

  • lat - a float representing the latitude coordinate. This is used in geotagging the post with lon.

  • lon - a float representing the longitude coordinate. This is used in geotagging the post with lat.

  • smartlink_url - a string representing a URL to a website. This link will be scraped to generate a smartlink preview.

In addition to primitive and custom scalar types, the Publish API also has a few custom types to support post generation:

  • event - an object containing metadata for the creation of a Nextdoor event
    • title - a string representing the title of the event
    • description - a string representing the description of the event
    • startTime - a datetime in ISO8601 format representing the start time of the event
    • endTime - a datetime in ISO8601 format representing the end time of the event
    • coverPhoto - a string representing a URL to an image for the cover photo of the event
    • virtualEventLink - a string representing a virtual link of the event
  • fsf - an object containing metatdata for the creation of a Nextdoor FSF listing
    • title - a string representing the title of the listing
    • description - a string representing the description of the listing
    • price - a string representing the price of the listing in USD
    • category - a string representing the category of the listing
      • Here is the following list of categories we support:
        'APPLIANCES'
        'AUTOMOTIVE'  
        'BABY_AND_KIDS'  
        'BICYCLES'  
        'CLOTHING'  
        'ELECTRONICS'  
        'FURNITURE'  
        'GARAGE_SALES'  
        'GARDEN'  
        'HOME_DECOR'  
        'HOME_SALES'  
        'IN_SEARCH_OF'  
        'MUSICAL_INSTRUMENTS'  
        'NEIGHBOR_MADE'  
        'NEIGHBOR_SERVICES'  
        'OTHER'  
        'PET_SUPPLIES'  
        'PROPERTY_RENTALS'  
        'SPORTS_AND_OUTDOORS'  
        'TICKETS'  
        'TOOLS'  
        'TOYS_AND_GAMES'
        
    • image_attachments - a list of strings representing the image attachments of the listing.