# API

## How do you hook into OneStopShop?

![](/files/-MLPW1qc8_gvuCVJqe-a)

**API Download**: [Link](https://www.mediafire.com/file/mk3a64zssfm4kar/OneStopShopAPI.jar/file)

1. Download the API jar above and add it into your IDE plugin project dependencies as "provided" so the jar does not compile with the API jar included.
2. Open your **`plugin.yml`** in your project and add **`softdepend: [OneStopShop]`** or depending on what type of plugin you're making add **`depend: [OneStopShop]`**.
3. Now you're ready to get the plugin's methods, use the following:

```
OneStopShopAPI api = OneStopShop.getPlugin().getApi();

Examples:

# add a item to a shop
api.addShopItem(item, "armor-shop", 100.0, 500.0);

# get a item buy value
Double buy = api.getItemBuyValue(item);

# get a item sell value
Double sell = api.getItemSellValue(item);
```

## API Methods

```
public void addShopItem(ItemStack item, String shop, double sell, double buy) {

}

public double getItemSellValue(ItemStack item) {

}

public double getItemBuyValue(ItemStack item) {

}
```


---

# 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://sirgoldman.gitbook.io/sirgoldmans-plugins/plugins/onestopshop/api.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.
