The Tearline API reference is organized by resource type. Each resource type has one or more data representations and one or more methods.



HTTP Request


pages/?type=public_pages.PublicPage GET Returns JSON object containing all public post content. No authentication credentials required.

Example route for returning all fields for most recent article*&order=-first_published_at&limit=1

Code Example: Get Public Post Data

#get all public posts
    import requests
    import re

    url = '';

    method = 'pages/?type=public_pages.PublicPage&fields=*';

    # call public pages
    response = requests.get(url + method);

    print( "status: ", response.json()['status'])
    print( "count_total: ", response.json()['total_count'], "n")

    for post in response.json()['posts']:
        print( "Post Title: ", post['title'] )
        print( "Post Type: ", post['type'] )
        print( "Post ID: ", post['id'] )

    # get all id's of public posts
    public_id = [ post['id'] for post in response.json()['posts'] ]