Generate a Presentation Slide by Slide
Generates a custom presentation by allowing you to define the structure and content of each slide individually. Specify titles, layouts, item counts, and content for every slide, along with the presentation template. This endpoint is ideal for advanced users who require precise control over the presentation’s flow and appearance. Returns a task ID for asynchronous processing; poll the task status to retrieve the completed presentation file.
Headers
Section titled “Headers”application/json
The API key to use for the request.
<YOUR_API_KEY>
Body Parameters
Section titled “Body Parameters”A list of slides, each defined as a dictionary. The keys are:
The title of the slide.
The layout type for the slide. See available layout options below.
Number of items for the slide (must match the layout constraints).
The content to be generated for the slide.
The URL of a custom image to be used for the slide.
See the available layout options in the Layouts section and sample body below for further reference about the contents of each key.
The name of the template or the ID of a custom template. See the custom templates section for more information.
For options, see the Get All Templates endpoint.
The language to use in the presentation.
Whether to include stock images.
Whether to include the ‘cover’ slide.
Whether to include the ‘table of contents’ slides.
Code Examples
Section titled “Code Examples”curl -X POST https://api.slidespeak.co/api/v1/presentation/generate/slide-by-slide -H "Content-Type: application/json" -H "x-api-key: <YOUR_API_KEY>" -d '{ "template": "default", "language": "ENGLISH", "fetch_images": true, "slides": [ { "title": "Introduction to African Wildlife", "layout": "items", "item_amount": 3, "content": "Diversity of Species Over 1,100 mammal species, including iconic animals like elephants, lions, and rhinoceroses. Approximately 2,600 bird species, making Africa a birdwatcher's paradise. Ecosystems and Habitats Savannas: Home to large herbivores and predators, characterized by grasslands and scattered trees." }, { "title": "Conservation Success Timeline", "layout": "timeline", "item_amount": 4, "content": "1961: World Wildlife Fund established. 1973: CITES treaty signed to regulate wildlife trade. 1989: Ivory trade ban implemented globally. 2016: African elephant population stabilizes in protected areas." }, { "title": "Threats vs Solutions", "layout": "comparison", "item_amount": 2, "content": "Threats: Poaching for ivory and rhino horn, habitat loss due to agriculture, human-wildlife conflict in border areas. Solutions: Anti-poaching patrols, community conservation programs, wildlife corridors connecting protected areas." }, { "title": "Key Statistics", "layout": "big-number", "item_amount": 3, "content": "1.1 million square kilometers of protected areas across Africa. 70% decline in wildlife populations since 1970. $29.2 billion annual revenue from wildlife tourism." } ] }'
const requestBody = { template: 'default', language: 'ENGLISH', fetch_images: true, slides: [ { title: 'Introduction to African Wildlife', layout: 'items', item_amount: 3, content: "Diversity of Species Over 1,100 mammal species, including iconic animals like elephants, lions, and rhinoceroses. Approximately 2,600 bird species, making Africa a birdwatcher's paradise. Ecosystems and Habitats Savannas: Home to large herbivores and predators, characterized by grasslands and scattered trees." }, { title: 'Conservation Success Timeline', layout: 'timeline', item_amount: 4, content: '1961: World Wildlife Fund established. 1973: CITES treaty signed to regulate wildlife trade. 1989: Ivory trade ban implemented globally. 2016: African elephant population stabilizes in protected areas.' }, { title: 'Threats vs Solutions', layout: 'comparison', item_amount: 2, content: 'Threats: Poaching for ivory and rhino horn, habitat loss due to agriculture, human-wildlife conflict in border areas. Solutions: Anti-poaching patrols, community conservation programs, wildlife corridors connecting protected areas.' }, { title: 'Key Statistics', layout: 'big-number', item_amount: 3, content: '1.1 million square kilometers of protected areas across Africa. 70% decline in wildlife populations since 1970. $29.2 billion annual revenue from wildlife tourism.' } ]};
fetch('https://api.slidespeak.co/api/v1/presentation/generate/slide-by-slide', { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-api-key': '<YOUR_API_KEY>' }, body: JSON.stringify(requestBody)}) .then(response => { return response.json(); }) .then(data => { console.log('Response:', data); }) .catch(error => { console.error('Error:', error); });
import requests
url = "https://api.slidespeak.co/api/v1/presentation/generate/slide-by-slide"headers = { "Content-Type": "application/json", "x-api-key": "<YOUR_API_KEY>"}payload = { "template": "default", "language": "ENGLISH", "fetch_images": True, "slides": [ { "title": "Introduction to African Wildlife", "layout": "items", "item_amount": 3, "content": ( "Diversity of Species Over 1,100 mammal species, including iconic animals like elephants, " "lions, and rhinoceroses. Approximately 2,600 bird species, making Africa a birdwatcher's paradise. " "Ecosystems and Habitats Savannas: Home to large herbivores and predators, characterized by grasslands and scattered trees." ) }, { "title": "Conservation Success Timeline", "layout": "timeline", "item_amount": 4, "content": ( "1961: World Wildlife Fund established. 1973: CITES treaty signed to regulate wildlife trade. " "1989: Ivory trade ban implemented globally. 2016: African elephant population stabilizes in protected areas." ) }, { "title": "Threats vs Solutions", "layout": "comparison", "item_amount": 2, "content": ( "Threats: Poaching for ivory and rhino horn, habitat loss due to agriculture, " "human-wildlife conflict in border areas. Solutions: Anti-poaching patrols, community conservation programs, " "wildlife corridors connecting protected areas." ) }, { "title": "Key Statistics", "layout": "big-number", "item_amount": 3, "content": ( "1.1 million square kilometers of protected areas across Africa. " "70% decline in wildlife populations since 1970. $29.2 billion annual revenue from wildlife tourism." ) } ]}
response = requests.post(url, headers=headers, json=payload)print(response.json())
<?phprequire 'vendor/autoload.php';
use GuzzleHttpClient;
$client = new Client();
$headers = [ 'Content-Type' => 'application/json', 'x-api-key' => '<YOUR_API_KEY>'];
$payload = [ "template" => "default", "language" => "ENGLISH", "fetch_images" => true, "slides" => [ [ "title" => "Introduction to African Wildlife", "layout" => "items", "item_amount" => 3, "content" => "Diversity of Species Over 1,100 mammal species, including iconic animals like elephants, lions, and rhinoceroses. " . "Approximately 2,600 bird species, making Africa a birdwatcher's paradise. Ecosystems and Habitats Savannas: Home to large herbivores " . "and predators, characterized by grasslands and scattered trees." ], [ "title" => "Conservation Success Timeline", "layout" => "timeline", "item_amount" => 4, "content" => "1961: World Wildlife Fund established. 1973: CITES treaty signed to regulate wildlife trade. " . "1989: Ivory trade ban implemented globally. 2016: African elephant population stabilizes in protected areas." ], [ "title" => "Threats vs Solutions", "layout" => "comparison", "item_amount" => 2, "content" => "Threats: Poaching for ivory and rhino horn, habitat loss due to agriculture, human-wildlife conflict in border areas. " . "Solutions: Anti-poaching patrols, community conservation programs, wildlife corridors connecting protected areas." ], [ "title" => "Key Statistics", "layout" => "big-number", "item_amount" => 3, "content" => "1.1 million square kilometers of protected areas across Africa. " . "70% decline in wildlife populations since 1970. $29.2 billion annual revenue from wildlife tourism." ] ]];
$response = $client->post('https://api.slidespeak.co/api/v1/presentation/generate/slide-by-slide', $payload);
$body = $response->getBody();$data = json_decode($body, true);
print_r($data);
Example body
Section titled “Example body”{ "template": "default", "language": "ENGLISH", "fetch_images": true, "slides": [ { "title": "Introduction to African Wildlife", "layout": "items", "item_amount": 3, "content": "Diversity of Species Over 1,100 mammal species, including iconic animals like elephants, lions, and rhinoceroses. Approximately 2,600 bird species, making Africa a birdwatcher's paradise. Ecosystems and Habitats Savannas: Home to large herbivores and predators, characterized by grasslands and scattered trees." }, { "title": "Conservation Success Timeline", "layout": "timeline", "item_amount": 4, "content": "1961: World Wildlife Fund established. 1973: CITES treaty signed to regulate wildlife trade. 1989: Ivory trade ban implemented globally. 2016: African elephant population stabilizes in protected areas." }, { "title": "Threats vs Solutions", "layout": "comparison", "item_amount": 2, "content": "Threats: Poaching for ivory and rhino horn, habitat loss due to agriculture, human-wildlife conflict in border areas. Solutions: Anti-poaching patrols, community conservation programs, wildlife corridors connecting protected areas." }, { "title": "Key Statistics", "layout": "big-number", "item_amount": 3, "content": "1.1 million square kilometers of protected areas across Africa. 70% decline in wildlife populations since 1970. $29.2 billion annual revenue from wildlife tourism." } ] }
Response
Section titled “Response”{ "task_id": "353509d6-8efe-401c-a8a9-53ca64b520a3"}
Example Task Result
Section titled “Example Task Result”{ "task_id": "353509d6-8efe-401c-a8a9-53ca64b520a3", "task_status": "SUCCESS", "task_result": { "url": "https://slidespeak-files.s3.us-east-2.amazonaws.com/24d89111-71a1-4c05-a909-2d84123c9ba9.pptx" }, "task_info": { "url": "https://slidespeak-files.s3.us-east-2.amazonaws.com/24d89111-71a1-4c05-a909-2d84123c9ba9.pptx" }}