# Convert Postman Collection to OpenAPI Yaml

1. **Download the tool**:

   * Before you begin, you'll need to install a tool called **`postman-to-openapi`**. This tool will help you convert your Postman Collection to OpenAPI YAML format. You can install it using **npm**, a package manager for JavaScript.
   * Open your command line interface (CLI) and run the following command:

   ```bash
   npm i postman-to-openapi -g
   ```

   * This command will install the **`postman-to-openapi`** tool globally on your system, allowing you to use it from any directory.
2. **Export your Postman Collection as JSON**:
   * Open Postman and locate the collection you want to convert.
   * Click on the collection, then click on the "Export" button.
   * Choose "Export as JSON" from the options. This will download your Postman Collection in JSON format to your local machine.
3. **Run the conversion command**:

   * Navigate to the directory where you downloaded your Postman Collection JSON file using the CLI.
   * Once you're in the directory, run this command:

   ```bash
   p2o ./path/to/PostmanCollection.json -f ./out_openapi_.yml
   ```

   Replace `./path/to/PostmanCollection.json` with the actual path to your Postman Collection JSON file. Replace `./out_openapi_.yml` with the desired output file path for your OpenAPI YAML file. This is the file where the converted schema will be saved.
4. **Update the YAML file**:
   * Once the conversion process is complete, navigate to the directory where you saved the output OpenAPI YAML file.
   * Open the file using a text editor of your choice.
   * In the YAML file, you may need to update certain sections such as **`basePathUrl`** and any other variables to match your specific API configuration. These are typically found at the beginning of the YAML file and may include details like the base URL of your API and other parameters.
5. **Save your changes**:
   * After making any necessary updates to the YAML file, save the file in your text editor.

By following these steps, you should be able to successfully convert your Postman Collection to OpenAPI YAML format and make any necessary adjustments to the resulting file.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.api.market/fundamentals/convert-postman-collection-to-openapi-yaml.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
