Documentation
Get started with documentation and helpful guides
for using the PestoAI developer API, embedding the code snippet, and more
Getting started with PestoAI
IMPORTANT! Before embedding the code snippet in your website, make sure you have connected your site in the PesotAI console and are using the correct embed snippet that is available in the site settings under 'connection instructuctions'
After you signup to PestoAI, you can log into the console with your email and password. The console allows you to connect your site, retrieve the code snippet to embed in your blog page, manage settings, and more.
Once you have connected your site, embedded the code snippet, and completed the style setup wizard, your first post will be generated. You can review, edit, publish, and unpublish posts from the console. You can also add an author profile to posts or set a default author profile on all posts.
Keep in mind that only published posts will be visible to viewers on the page in your website where you embedded the posts list
The PestoAI console also lets you manage site settings such as post frequency and auto-publish, as well as invite team members to collaborate with different permissions. To log in to the console, visit the following link:
If your site is hosted using Wordpress, Shopify, or Wix, you can easily install the PestoAI plugin/app instead of using our embedable snippet. The PestoAI plugin/app generates posts directly to the blog posts section in Wordpress/Shopify/Wix and is a convienient option for those who are already managing their blog posts in these services, or want to control their blog theme
PLEASE NOTE: If you need to edit or publish a post, please do so from the PestoAI console rather than from your Wordpress/Shopify/Wix so the two systems keep in sync
To install the PestoAI plugin/app, make sure you are logged in to your Wordpress/Shopify/Wix account and visit our plugin/app page:
PestoAI provides an embeddable code snippet that you embed in the html of your website's blog page. The snippet manages showing both your published posts list and entire post articles. Your site's specific embed code can be found in your site settings in the PestoAI console and will look something like this:
<script src="https://assets.pestoai.com/js/jquery.min.js"></script>
<script src="https://assets.pestoai.com/js/embed.js"
data-site-id="YOUR_SITE_ID">
</script>
<div class="pai-content"></div>
IMPORTANT! Make sure YOUR_SITE_ID is the correct site ID
The PestoAI API allows interaction with the service, offering two main RESTful API endpoints: one to retrieve a list of published posts, and another to retrieve content for a specific post. API responses are in JSON format.
AUTHORIZATION:
HEADER 'x-api-key' : YOUR_API_KEY
To make authorized API requets, use the API Key for your site as the value for the 'x-api-key' header. The API Key can be found in the PestoAI console site settings for that site. Each site has a different API Key.
You can find your API key and site ID by logging into your PestoAI account, and then navigating to the site settings > 'connection instructions'
GETTING THE LIST OF PUBLISHED POSTS:
GET https://api.pestoai.com/v1/getpublicpostsforsite
Retrieves the list of posts that have been generated and published for a site.
Only published posts will be returned by the API. You can publish a post from the PestoAI console or you can turn on auto-publish to have newly generated posts published automatically
Example request properties:
"site_id": "YOUR_SITE_ID", //You can find your site id in the site settings in the PestoAI console
"response_format": "json",
"limit": 10, //The anmount of posts you want to be returned in one page
"start_key": "LAST_KEY" || null, //This is used to get the next page of posts
Example response:
{
"posts": [
{
"site_id": "SITE_ID",
"post_id": "POST_ID",
"title": "POST_TITLE",
"lookup_id": "LOOKUP_ID",
"published_time": "JAVASCRIPT_DATE",
"image_url": "POST_IMAGE_URL" //An AI generated image that relates to the post. null if it does not exist
}
],
"lastKey": "LAST_KEY", //This is used to get the next page of posts by supplied it as the start_key in the next request
"response_format": "json"
}
GETTING THE CONTENT OF A POSTS:
GET https://api.pestoai.com/v1/getpostcontent
Retrieves content for a specific post. Expects request body with site_id, post_id, and response_format (json only).
Example request properties:
"site_id": "SITE_ID", //This will be on each post that was retrieved via the getpublicpostsforsite API
"post_id": "POST_ID", //This will be on each post that was retrieved via the getpublicpostsforsite API
"response_format": "json"
Example response:
{
"site_id": "SITE_ID",
"post_id": "POST_ID",
"title": "POST_TITLE",
"lookup_id": "LOOKUP_ID",
"published_time": "JAVASCRIPT_DATE",
"image_url": "POST_IMAGE_URL", //An AI generated image that relates to the post. null if it does not exist
"content": "POST_CONTENT",
"author" = {
"id": "PROFILE_ID",
"name": "FULL_NAME",
"image_url": "PROFILE_IMAGE_URL", //null if it does not exist
"social_url": "PROFILE_SOCIAL_URL", //null if it does not exist
"bio": "PROFILE_SOCIAL_URL", //null if it does not exist
},
"response_format": "json"
}
PestoAI has convenient iOS and Android apps that allow you to easily manage your sites and posts on the go. The apps have all the important funcitonlity that the web console has including the ability to edit posts. To use the apps on your iPhone or Android device simply download them from the Apple App Store or Google Play Store.
PLEASE NOTE: The iOS app does not currently have billing management. If you need to manage billing, please do so from the PestoAI web console