API

Purpose

To allow people to update the data for their server by other means than the closed source MarketSense app.

How to get a Valid GUID (API KEY):

To use the API you must have a valid key(GUID). This is appended to any requests via the url as a querry string. To get the GUID you can validate, you need to have the marketsense app and have uploaded inventory data to get the inventory link that contains your GUID. Example below:

https://www.ffxivmb.com/Inventory/[GUIDISHERE]/Balmung

To validate the guid you must have uploaded valid price data for the server using your MarketSense app. Another way to get a valid guid is to msg @purveyor in the discord and ask for one. Later on there will be an automated process for this.

In summary, to get a valid GUID to use as a token you would need to run the MarketSense app, run it successfully and upload the price of an item, upload your inventory data and the GUID in your inventory link would be a valid GUID to use in the next steps. Alternatively you can msg @purveyor in the discord.

In case you missed it, if you are a ps4, or mac/linux user or the MarketSense app doesn't work for you, you can still contact @purveyor on the discord to get a key, you don't need to run the App if you can't/don't want to.

How to construct the POST request to send the price and history data:

To Send Price Data you would use:

https://ffxivmb.com/public/api/Prices?Server='SERVER'&SourceGuid='GUID'&ItemKey='ITEMKEY'

For sending Prices you would include a json in the request body like this:

[{ "CraftSignature":CraftSignature [string],
"IsCrafted":IsCrafted [boolean],
"Materia":Materia [List[int]],
'PricePerUnit':PricePerUnit [int],
'PriceTotal':PriceTotal [int],
'Quantity':Quantity [int],
'IsHQ':IsHQ [boolean],
"RetainerName":RetainerName [string],
"Stain":Stain [int],
"TownID": TownID [int],
"DateObtained":DateObtained [int NOTE-The UnixTimeStamp of when you obtained this price]
},]

It would be a list of the prices objects organized as above, with the types as they are stated inside []. If there are NO ITEMS FOR SALE you would send one object in the list with all the fields with their default(0, '', false) values except the date obtained in which you would place the Unix timestamp of the time you checked the price at.

To send Price History information you would use:

https://ffxivmb.com/public/api/History?Server='SERVER'&SourceGuid='GUID'&ItemKey='ITEMKEY'
you would also include a json in the request body organized as this:

[{'CharacterName':CharacterName [string],
'PricePerUnit':PricePerUnit [int],
'PriceTotal':PriceTotal [int],
'Quantity':Quantity [int],
'IsHQ':IsHQ [int NOTE-Not a Boolean],
'PurchaseDate':PurchaseDate [int NOTE-UnixTimeStamp of the sale date]
},]

NOTE: DO NOT INCLUDE THE TYPES, THOSE ARE JUST TO GUIDE YOU ON HOW TO SUBMIT DATA.

Limits:

It is limited to 60 posts a minute, if you make mistakes it will be less. If you need more, hop on the discord and ask for more.
If the data you send is wrong, you will be automatically banned after a while and it will delete all data coming from your Guid and IP. So test your program before running it. If you got banned and fixed whatever was wrong, message me on the discord.