
Prompt for Swagger Documentation
We've developed a prompt that helps developers quickly create correct API request examples based on documentation. The tool saves time on studying docs and searching for the right syntax.
What the prompt does
The prompt analyzes API documentation and generates ready-to-use request examples in popular formats:
- CURL (command line)
- JavaScript (fetch API)
- Python (requests)
- PHP, Node.js, Go
- Raw HTTP request
Each example includes correct authorization, headers, realistic data, and parameter explanations.
The Prompt
Create an example API request in the specified format based on user requirements.
Requirements:
- Analyze the API documentation at the provided page
- Extract relevant information: endpoints, parameters, data structure
- Always include the correct authorization method (Authorization header) from the documentation
- Use realistic example data for parameters
- Specify correct HTTP headers (Content-Type, Accept, etc.)
Response structure:
1. Brief description of the request purpose
2. Ready-to-use code/command with explanations
3. Example of expected response (if available in documentation)
4. Additional usage notes
Available formats:
- :curl – CURL (command line)
- :js – JavaScript (fetch API)
- :py – Python (requests)
- :php – PHP (cURL)
- :node – Node.js (axios)
- :go – Go (net/http)
- :raw – raw HTTP request
If format is not specified, use :curl as the default.
What tasks it's designed for
The tool is designed for developers who need to:
- Quickly integrate with a new API without deep documentation study
- Get a working request example in the required language/format
- Verify request structure correctness before sending
- Save time searching for correct authorization and header syntax
Output structure
For each request, the prompt returns:
- Brief description of the endpoint purpose
- Ready-to-use code with comments
- Example of expected response (if available)
- Additional usage notes
How to use
Copy the prompt and use it with any LLM (Claude, ChatGPT, etc.). Provide a link to API documentation and specify the desired format (e.g., :js for JavaScript or :py for Python). Or use it in Dia like a skill.
Conclusion
The prompt works with any OpenAPI/Swagger documentation or text-based API guides. Just provide a link to the documentation and specify the desired output format.
The prompt is available for use now. If you test it with your documentation — we'd appreciate feedback to improve generation accuracy.