---
title: Competitor data endpoints
slug: competitor-data-endpoints
description: Learn how to effectively use the API to create and update competitor data in the Competitor table with this handy reference guide. Discover how to define competitors schema, load competitor prices into Pricemoov, and access example API requests and parame
icon: 🏇
docTags: 
createdAt: 2023-05-17T17:10:46.000Z
---

# Quick reference

| Verb | Path                                                 | Method                          |
| ---- | ---------------------------------------------------- | ------------------------------- |
| POST | /api/v1/competitor\_prices/schema/create\_schema/    | Create competitors schema       |
| POST | /api/v1/competitor\_prices/bulk\_create\_or\_update/ | Bulk update competitors entries |

# Define Competitors Schema

## Description

With our API, you can easily create or update entries in our Competitor table. This table keeps track of all your competitors data. Before that you need to define the competitors schema.

```shell
curl --location --request POST 'https://api.pricemoov.com/api/v1/competitor_prices/schema/create_schema/' \
--header 'Authorization: jwt <your_token>' \
--raw-data '{
    "attributes_config":[
	    "code",
	    "product_attribute_1",
		"product_attribute_2",
	    "product_attribute_X",
		"extension_name_1",
		"extension_name_2",
	    "extension_name_Y"
	],
	"is_dated": false
}'
```

## Parameters

::::VerticalSplit{layout="left"}
:::VerticalSplitItem
attributes\_config                   `type: list[string]`, `Required`




&#x20;

&#x20;is\_dated
`type: boolean`, `default: false`,`Optional`
:::

:::VerticalSplitItem
Allow to defined the granularity of competitors data. It corresponds to a subset of the product catalog fields (`code`,  `product_attribute_1`, `product_attribute_X`, `extension_name_1`, `extension_name_Y`.....). ⚠️ Note that if the product `code` is specified, then it is not necessary to add any product attributes (`product_attribute_1`, `product_attribute_X`, …).

For rental users, this allows to specify a date at which the corresponding item would be rented.


:::
::::

## Example

Upon success, the response is 201 and returns

```json
{
    "input": {
        "dimensions": [
            "code",
            "product_attribute_1"
            "product_attribute_2",
            "product_attribute_X",
            "extension_name_1", 
            "extension_name_2", 
            "extension_name_Y"
        ]
    },
    "output": {"total": "Decimal", "latest_update": "date"},
}
```

##

# Loading competitor prices into Pricemoov

## Description

With our API, you can easily create or update entries in your competitors table. This table keeps track of all your the prices of your competitors.

```shell
curl --location --request POST 'https://api.pricemoov.com/api/v1/competitor_prices/bulk_create_or_update/' \
--header 'Authorization: jwt <your_token>' \
--raw-data '[
    {
          "code": "pc_value",
          "product_attribute_1": "pa_value_1",
          "product_attribute_2": "pa_value_2",
          "product_attribute_X": "pa_value_X",
          "extension_name_1": "en_value_1",
          "extension_name_2": "en_value_2",
          "extension_name_X": "en_value_X",
          "competitor_price": "59", 
          "competitor_name": "NotMyCompany",
          "departure_date": "2023-07-14", // Note: this field is optional
          "latest_update": "2023-05-05" // Note: this field is optional
     }, ...
]'
```

## Parameters

::::VerticalSplit{layout="left"}
:::VerticalSplitItem
code, product\_attribute\_1, product\_attribute\_2, product\_attribute\_X, extension\_name\_1,extension\_name\_2, extension\_name\_Y.      `type: string`, `Optional|Required`

competitor\_price
`type: float`, `Required`

competitor\_name&#x20;
`type: string`, `Required`

departure\_date
`type: date`, `Optional`

latest\_update                                `type: date|datetime`, `default: ingestion_date`, `Optional`

:::

:::VerticalSplitItem
Field from Product Catalog defined by competitors schema.







Corresponds to the price of the item for the competitor


Name of your competitor.


For rental users: date at which the item is rented. Format should be `yyyy-mm-dd`

Optional date or datetime at which you recorded this competitor price. If not given, it will be set to the date at which you call this API. Format should be ISO 8601 (e.g. `2023-01-06T09:32:02.788611Z`).&#x20;
:::
::::



## Example

Upon success, the response is 201 and returns

```json
{
    "created": [created_hash],
    "updated": [updated_hash],
}
```

##

