const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
topic: 'Photosynthesis in plants',
type: 'notes',
name: 'Photosynthesis Study Plan',
context: 'Focus on light-dependent and light-independent reactions',
folderId: '<string>',
length: 'medium',
level: 'college',
references: [{title: 'Understanding Photosynthesis', url: 'https://example.com/article'}]
})
};
fetch('https://studyfetchapi.com/api/v1/materials/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://studyfetchapi.com/api/v1/materials/generate \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"topic": "Photosynthesis in plants",
"type": "notes",
"name": "Photosynthesis Study Plan",
"context": "Focus on light-dependent and light-independent reactions",
"folderId": "<string>",
"length": "medium",
"level": "college",
"references": [
{
"title": "Understanding Photosynthesis",
"url": "https://example.com/article"
}
]
}
'import requests
url = "https://studyfetchapi.com/api/v1/materials/generate"
payload = {
"topic": "Photosynthesis in plants",
"type": "notes",
"name": "Photosynthesis Study Plan",
"context": "Focus on light-dependent and light-independent reactions",
"folderId": "<string>",
"length": "medium",
"level": "college",
"references": [
{
"title": "Understanding Photosynthesis",
"url": "https://example.com/article"
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"_id": "<string>",
"name": "<string>",
"organizationId": "<string>",
"folderId": "<string>",
"contentType": "text",
"content": {
"text": "<string>",
"url": "<string>",
"s3Key": "<string>",
"s3Url": "<string>",
"filename": "<string>",
"fileSize": 123,
"mimeType": "<string>"
},
"status": "active",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"metadata": {},
"usage": {},
"references": [
{
"title": "Understanding Photosynthesis",
"url": "https://example.com/article"
}
],
"generationMetadata": {}
}Generate material from a topic
Uses AI to generate study materials like outlines, notes, summaries, etc. from a given topic. Returns immediately without waiting for processing.
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
topic: 'Photosynthesis in plants',
type: 'notes',
name: 'Photosynthesis Study Plan',
context: 'Focus on light-dependent and light-independent reactions',
folderId: '<string>',
length: 'medium',
level: 'college',
references: [{title: 'Understanding Photosynthesis', url: 'https://example.com/article'}]
})
};
fetch('https://studyfetchapi.com/api/v1/materials/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://studyfetchapi.com/api/v1/materials/generate \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"topic": "Photosynthesis in plants",
"type": "notes",
"name": "Photosynthesis Study Plan",
"context": "Focus on light-dependent and light-independent reactions",
"folderId": "<string>",
"length": "medium",
"level": "college",
"references": [
{
"title": "Understanding Photosynthesis",
"url": "https://example.com/article"
}
]
}
'import requests
url = "https://studyfetchapi.com/api/v1/materials/generate"
payload = {
"topic": "Photosynthesis in plants",
"type": "notes",
"name": "Photosynthesis Study Plan",
"context": "Focus on light-dependent and light-independent reactions",
"folderId": "<string>",
"length": "medium",
"level": "college",
"references": [
{
"title": "Understanding Photosynthesis",
"url": "https://example.com/article"
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"_id": "<string>",
"name": "<string>",
"organizationId": "<string>",
"folderId": "<string>",
"contentType": "text",
"content": {
"text": "<string>",
"url": "<string>",
"s3Key": "<string>",
"s3Url": "<string>",
"filename": "<string>",
"fileSize": 123,
"mimeType": "<string>"
},
"status": "active",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"metadata": {},
"usage": {},
"references": [
{
"title": "Understanding Photosynthesis",
"url": "https://example.com/article"
}
],
"generationMetadata": {}
}Authorizations
API Key for server-to-server authentication. Resolves to the owning organization.
Body
Topic or context to generate material from
"Photosynthesis in plants"
Type of material to generate
outline, overview, notes, summary "notes"
Name for the generated material
"Photosynthesis Study Plan"
Additional context or details about the topic
"Focus on light-dependent and light-independent reactions"
Target folder ID
Length of the generated content
short, medium, long Target education level
high_school, college, professional "college"
References that this material cites
Show child attributes
Show child attributes
Response
Material generated successfully
Material ID
Material name
Organization ID
Folder ID
Content type
text, pdf, video, audio, image, epub Material content
Show child attributes
Show child attributes
Material status
active, processing, pending_upload, error, deleted Creation timestamp
Last update timestamp
Material metadata
Usage information
References that this material cites
Show child attributes
Show child attributes
Generation metadata
Was this page helpful?