Quick Start
Get up and running with the MagicSlides API in just a few minutes. Follow these simple steps to generate your first presentation.
Get Your API Key
Your API key is your unique authentication token for all API requests. You can get it from your MagicSlides dashboard settings.
Get Your API Key
- Open your MagicSlides dashboard settings
- Generate a new API key
- Copy your API key (format:
ms-api-...)
Alternative: Using Email and AccessId
For backward compatibility, you can also use email and accessId. However, API key authentication is recommended.
Make Your First API Call
Let's generate a presentation from a topic. This is the simplest endpoint to get started with.
Endpoint
POST https://api.magicslides.app/public/api/ppt-from-textThis is the unified API endpoint that handles all input types (topics, summaries, YouTube, websites, PDFs, DOCX).
Choose Your Language
TypeScript/JavaScript
import axios from 'axios';
async function generatePresentation() {
try {
const response = await axios.post(
'https://api.magicslides.app/public/api/ppt-from-text',
{
apiKey: 'ms-api-your-api-key-here',
topic: 'Introduction to Artificial Intelligence',
language: 'en',
slideCount: 5
},
{
headers: {
'Content-Type': 'application/json'
}
}
);
console.log('Success!', response.data);
console.log('Presentation URL:', response.data.url);
console.log('PPT ID:', response.data.pptId);
return response.data;
} catch (error) {
console.error('Error:', error.response?.data || error.message);
throw error;
}
}
// Call the function
generatePresentation();Python
import requests
def generate_presentation():
try:
response = requests.post(
'https://api.magicslides.app/public/api/ppt-from-text',
json={
'apiKey': 'ms-api-your-api-key-here',
'topic': 'Introduction to Artificial Intelligence',
'language': 'en',
'slideCount': 5
},
headers={
'Content-Type': 'application/json'
}
)
response.raise_for_status()
data = response.json()
print('Success!', data)
print('Presentation URL:', data['url'])
print('PPT ID:', data['pptId'])
return data
except requests.exceptions.RequestException as e:
print('Error:', e.response.json() if e.response else str(e))
raise
# Call the function
generate_presentation()cURL
curl -X POST https://api.magicslides.app/public/api/ppt-from-text \
-H "Content-Type: application/json" \
-d '{
"apiKey": "ms-api-your-api-key-here",
"topic": "Introduction to Artificial Intelligence",
"language": "en",
"slideCount": 5
}'Important Notes
- Replace
ms-api-your-api-key-herewith your API key from Step 1 - The
slideCountparameter is optional (default: 10, max: 50) - All other parameters are optional - this minimal example will work!
- You can also use
emailandaccessIdinstead ofapiKeyfor backward compatibility
Handle the Response
The API will return a JSON response with your presentation URL and metadata.
Success Response
{
"status": "success",
"message": "Presentation generated successfully",
"inputType": "topic",
"url": "https://example.com/path/to/presentation.pptx",
"pptId": "presentation-id",
"pdfUrl": "https://example.com/path/to/presentation.pdf",
"json": {
"presentationTitle": "Introduction to Artificial Intelligence",
"slides": [...]
},
"tokenUsed": 1234
}Error Response
{
"status": "failed",
"message": "Invalid API key",
"error": {
"field": "apiKey",
"message": "Invalid API key",
"code": "AUTH_ERROR"
}
}What to do with the response:
- The
urlcontains the download link for your presentation - The
pptIdis a unique identifier for the presentation - The
pdfUrlcontains a PDF version if available - You can download the file, share the URL, or embed it in your application
- The presentation is available in PPTX format
- Always check the
statusfield before accessing the data
Next Steps
Now that you've made your first API call, explore more features:
Common Issues
Error: Invalid API key
Make sure you've copied your API key correctly and haven't included any extra spaces. Verify it in your dashboard settings. If using email/accessId, ensure both are correct.
Error: Rate limit exceeded
You've made too many requests. Wait a few minutes before trying again. Check the rate limits page for details.
No response or timeout
Presentation generation can take 30-60 seconds. Make sure your code handles async operations properly and has appropriate timeout settings.
Need Help?
If you're stuck or have questions, we're here to help: