Tilda API

Automatic Tilda project integration with your own website
All requests are sent using the GET method and the response is returned in JSON format.

The successful response is:

{
  "status": "FOUND",
  ...
}
The error response is:

{
  "status": "ERROR",
  ...
}
There is a limit to the number of requests: 150 per hour.
API is used to synchronize content created on Tilda with your website. It is forbidden to request the Tilda server to retrieve data for every user's visit to your website.

All content must be saved to your server (including images, scripts, and styles) before it can be distributed to users. If you create load by constantly sending requests to Tilda API servers, your account may be blocked and the API feature will be deactivated.

If the algorithm of synchronization is well organized, there should be 1-3 requests, therefore, 150 requests to the server per hour are more than enough. There should be no requests after synchronization until you've changed something on the page, in this case, you'll have to synchronize the information again.
How To Start
Please note that the API feature is only available for Tilda Business Plan subscribers. To begin with, you need to get a Public Key and a Secret Key. You can get them in the API section on Tilda: Site Settings → Export → API Integration.
List of Requests
List of projects
/v1/getprojectslist

Project information
/v1/getprojectinfo

List of project pages
/v1/getpageslist

Page information (+ body html-code)
/v1/getpage

Page information (+ fullpage html-code)
/v1/getpagefull

Page information for export (+ body html-code)
/v1/getpageexport

Page full information for export (+ fullpage html-code)
/v1/getpagefullexport
The URLs for all requests: https://api.tildacdn.info
In each request, you need to send variables: publickey and secretkey, and optionally, depending on the request, projectid or pageid.
You can set the path values for images (export_imgpath), JS files (export_jspath), and CSS files (export_csspath) in the Export tab of Site Settings of every project.
Therefore, you can specify relative or absolute paths to the files that will be stored on your server if you want to create exact pages' copies on your server.
Getting the List of Projects
GET Request URL:
https://api.tildacdn.info/v1/getprojectslist/?publickey=00000000000000000000&secretkey=00000000000000000000
GET Request URL:

https://api.tildacdn.info/v1/getprojectslist/?publickey=00000000000000000000&secretkey=00000000000000000000
Response in JSON format:

{
  "status": "FOUND",
  "result": [
    {
      "id": "0",
      "title": "First Project",
      "descr": "Some info"
    },
    {
      "id": "1",
      "title": "Second Project",
      "descr": ""
    },
    ...
  ]
}
Getting Project Information:
GET Request URL:
https://api.tildacdn.info/v1/getprojectinfo/?publickey=00000000000000000000&secretkey=00000000000000000000&projectid=0
GET Request URL:

https://api.tildacdn.info/v1/getprojectinfo/?publickey=00000000000000000000&secretkey=00000000000000000000&projectid=0
Response in JSON format:

{
  "status": "FOUND",
  "result": {
    "id": "0",
    "title": "Project title",
    "descr": "",
    "customdomain": "project.com",
    "export_csspath": "",
    "export_jspath": "",
    "export_imgpath": "",
    "indexpageid": "0",
    "customcsstext": "y",
    "favicon": "",
    "page404id": "0",
    "images": [
      {
        "from": "",
        "to": ""
      }
      ...
    ]
  }
}
To get a sample of your web server's configuration file, add the webconfig parameter with the htaccess or nginx value to the request URL.

If you use nginx, you need to add the received sample into the server section of your web server's configuration file.
Getting the List of Project Pages
GET Request URL:
https://api.tildacdn.info/v1/getpageslist/?publickey=00000000000000000000&secretkey=00000000000000000000&projectid=0
GET Request URL:

https://api.tildacdn.info/v1/getpageslist/?publickey=00000000000000000000&secretkey=00000000000000000000&projectid=0
Response in JSON format:

{
  "status": "FOUND",
  "result": [
    {
      "id": "1001",
      "projectid": "0",
      "title": "Page title first",
      "descr": "",
      "img": "",
      "featureimg": "",
      "alias": "",
      "date": "2014-05-16 14:45:53",
      "sort": "80",
      "published": "1419702868",
      "filename": "page1001.html"
    },
    {
      "id": "1002",
      "projectid": "0",
      "title": "Page title second",
      "descr": "",
      "img": "",
      "featureimg": "",
      "alias": "",
      "date": "2014-05-17 10:50:00",
      "sort": "90",
      "published": "1419702277",
      "filename": "page1002.html"
    },
    ...
  ]
}
Getting the Page Information
+ body HTML code
GET Request URL:
https://api.tildacdn.info/v1/getpage/?publickey=00000000000000000000&secretkey=00000000000000000000&pageid=1001
GET Request URL:

https://api.tildacdn.info/v1/getpage/?publickey=00000000000000000000&secretkey=00000000000000000000&pageid=1001
Response in JSON format:

{
  "status": "FOUND",
  "result": {
    "id": "1001",
    "projectid": "0",
    "title": "Page title",
    "descr": "",
    "img": "",
    "featureimg": "",
    "alias": "",
    "date": "2014-05-16 14:45:53",
    "sort": "80",
    "published": "1419702868",
    "html": "some html page code",
    "filename": "page1001.html",
    "js": [
      ...
    ],
    "css": [
      ...
    ]
  }
}
Getting the Page Information
+ full HTML code
GET Request URL:
https://api.tildacdn.info/v1/getpagefull/?publickey=00000000000000000000&secretkey=00000000000000000000&pageid=1001
GET Request URL:

https://api.tildacdn.info/v1/getpagefull/?publickey=00000000000000000000&secretkey=00000000000000000000&pageid=1001
Response in JSON format:

{
  "status": "FOUND",
  "result": {
    "id": "1001",
    "projectid": "0",
    "title": "Page title",
    "descr": "",
    "img": "",
    "featureimg": "",
    "alias": "",
    "date": "2014-05-16 14:45:53",
    "sort": "80",
    "published": "1419702868",
    "html": "some html page code",
    "filename": "page1001.html"
  }
}
Getting the Page Information For Export
+ body page HTML code
GET Request URL:
https://api.tildacdn.info/v1/getpageexport/?publickey=00000000000000000000&secretkey=00000000000000000000&pageid=1001
GET Request URL:

https://api.tildacdn.info/v1/getpageexport/?publickey=00000000000000000000&secretkey=00000000000000000000&pageid=1001
Response in JSON format:

{
  "status": "FOUND",
  "result": {
    "id": "1001",
    "projectid": "0",
    "title": "Page title",
    "descr": "",
    "img": "",
    "featureimg": "",
    "alias": "",
    "date": "2014-05-16 14:45:53",
    "sort": "80",
    "published": "1419702868",
    "images": [
      {
        "from": "",
        "to": ""
      },
      {
        "from": "",
        "to": ""
      },
      {
        "from": "",
        "to": ""
      }
    ],
    "html": "body page html-code with local links to files",
    "filename": "page1001.html"
  }
}
Important: We recommend that you download and keep updated page static files (scripts and styles) each time you use this request. These files are constantly changing, and you can't check if the files are updated through the API.
Getting the Page Information For Export
+ full page HTML code
GET Request URL:
https://api.tildacdn.info/v1/getpagefullexport/?publickey=00000000000000000000&secretkey=00000000000000000000&pageid=1001
GET Request URL:

https://api.tildacdn.info/v1/getpagefullexport/?publickey=00000000000000000000&secretkey=00000000000000000000&pageid=1001
Response in JSON format:

{
  "status": "FOUND",
  "result": {
    "id": "1001",
    "projectid": "0",
    "title": "Page title",
    "descr": "",
    "img": "",
    "featureimg": "",
    "alias": "",
    "date": "2014-05-16 14:45:53",
    "sort": "80",
    "published": "1419702868",
    "images": [
      {
        "from": "",
        "to": ""
      },
      {
        "from": "",
        "to": ""
      },
      {
        "from": "",
        "to": ""
      }
    ],
    "html": "full page html-code with local links to files",
    "filename": "page1001.html"
  }
}
Important: We recommend that you download and keep updated page static files (scripts and styles) each time you use this request. These files are constantly changing, and you can't check if the files are updated through the API.
Webhook (or Callback)
Synchronization can be performed automatically. To do this, specify the script URL where a request with notification will be sent whenever you click the "Publish" button. This way you can update content, as well as add new pages on your server.

You can specify the link to the webhook in the API section of your project: Site Settings → Export → API Integration:
The notification is sent using the GET method.
Parameters: pageid, projectid, published, publickey

Your webhook must confirm that the request was received. The expected response to the successful request is "ok"
(In PHP just echo "ok";)

If the Tilda server doesn't get the expected response, there will be 2 more attempts to repeat the request to your server (3 requests in total).

The request can be sent not at once, but with a delay of 1 to 20 min after publishing the page. Hence if the request didn't come at once, you need to check that it didn't come within the specified time period.
Important: The maximum response waiting time from your server is 5 seconds. If the response is not received, the connection is dropped. That's why you should save this notification and then perform synchronization—via cron, for example. Usually, if you have a lot of images on the page, this time is not enough.

how to
Examples Of Usage Scenarios
There are two common scenarios for using the Tilda API: If you need to automate exporting and saving all project files on your server, and if you need to integrate pages created on Tilda with your website templates.
How to export all pages in the project
Our goal is to save the project published in our Tilda account on our local server.
  • In the Export tab of the Site Settings, specify the paths for images, JS files, and CSS files, such as /images, /js, and /css;
  • Remember the projectid of the project you need;
  • Create a script on your server—it will send requests to the API, create files, and save information in these files;
  • Create folders on the server that you'll copy files to (images, js, css).
  1. Get information on the project you need by sending the getprojectinfo request.
  2. Loop through the image array that you've received in the request response. There is a list of files in it. You can find the source address of the file in the from variable and the local name you need to use for saving the file in the to variable. Copy the files where you need to. These files are common for all the pages in the project.
  3. If you've added the webconfig parameter to the previous request, you need to either create an .htaccess file and fill it with the webconfig variable's value or save this value to the server section of your nginx web server's configuration file.
  4. Get the list of all pages in our project by sending the getpageslist request.
  5. Loop through the page list you've received. For each page:
  • Get the page information for export by sending the getpagefullexport request;
  • Save images, scripts, and styles used on the page from the images, js, and css arrays to the server;
  • Create a new page file (using the name from the filename variable) and fill it with the html variable value.

If your goal is to integrate pages from Tilda into your template (that already has the header, menu, footer, etc.), then follow the same steps but use the getpageexport request. It returns body HTML code that you can paste into the content area of your template. Please note that in this case, you need to add scripts and styles in the template manually.
Integration without copying images and JS / CSS files

If your project is not heavily loaded and you don't want to save static files to your server, use the getpage request that returns body HTML code. The images will be loaded from the Tilda server. The main thing is to remember to add JS and CSS files to your template. The list of these files is returned in js and css variables of request response.

An example of a simple request using PHP:

$result = file_get_contents('https://api.tildacdn.info/v1/getprojectinfo/?publickey=00000000000000000000&secretkey=00000000000000000000&projectid=0');
$project = json_decode($result, true);
print_r($project);
In accordance with Tilda's Terms of Service Agreement, if you use the API export feature, you need to provide the "Made on Tilda" identifier with a link to https://tilda.cc as the source on every exported page.
Made on
Tilda