Git Product home page Git Product logo

mhwdb-api's Introduction

Please note: This is the source code for the Monster Hunter World API. If you're interested in using the API itself, please check out the docs.

Getting Started

Check out the contributing guide for information on contributing to the project. Feel free to drop into the project's Gitter chat and leave some suggestions!

$ git clone https://github.com/LartTyler/MHWDB-API.git

Using Vagrant

You can use the included Vagrant configuration to run your own development environment. If you're not familiar with Vagrant, check out their getting started guide.

In the project root, run:

$ vagrant up

Once the box is done provisioning, use vagrant ssh to access the box and run:

$ cd /vagrant
$ composer install
$ ./db-reset.sh latest
$ ./server-start.sh

The commands, in order, will perform the following tasks:

  • 1 and 2: Navigate to the project root and install dependencies
  • 3: Sync the boxes database with the most recent SQL file in the snapshots/ directory
  • 4: Start the webserver, which will make the API available on 127.0.0.1:8000

Manual Setup

Support is not provided for any development environments that are set up manually. If you open an issue, I'll try to help out as much as possible, but I can't promise anything. If you'd like your devleopment environment to be supported, please use the Vagrant configuration.

The project requires the following software in order to run:

  • PHP 7.1 or higher
  • Composer
  • Memcached
  • MySQL 5.7 or higher OR MariaDB 10.2 or higher

After ensuring that the above packages are available, copy the .env.dist file to .env and modify it to match your machine's configuration. Once you've done that, run the following commands to install the project requirements and start the web server.

$ ./db-reset.sh latest <dbname>
$ composer install
$ php bin/console server:start

Replace <dbname> with the name of the database you'll be using for the project.

Feature Tracking

I'm currently using a Trello board to track features and changes, which can be found here.

mhwdb-api's People

Contributors

larttyler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mhwdb-api's Issues

More flexibility with array query operators

As an example of what does work, you can easily filter through items when your target is a single field inside an array object element -- here's a query that asks for all armor pieces with at least one rank 4 decoration slot.

armor?q={"slots.rank": 4}&p={"slots.rank": true}

Can't ask much about fields holding arrays of non-object values

Here's a few different ways of asking for all weapons who support ammo and have at least one ammo type with a capacity of 3 at any level (all of which fail).

weapons?q={"ammo.capacities": 3}&p={"ammo": true}                    // empty response..
weapons?q={"ammo.capacities": { "$eq": 3 }}&p={"ammo": true }        // empty response..
weapons?q={"ammo.capacities": { "$contains": 3 }}&p={"ammo": true }  // Unrecognized operator: $contains

weapons?q={"ammo.capacities": { "$size": 3 }}&p={"ammo": true }      // $size is the only op that works -- not that it helps in what we wanted to do here

Here's a more likely scenario: ask for all bows that support the sleep coating.

weapons?q={"coatings": "sleep"}                  // empty response..
weapons?q={"coatings": {"$contains": "sleep"}}   // Unrecognized operator: $contains

Cannot ask about specific array indices

Let's define two ideas of sharpness in the context of how it's stored in the database: base sharpness and potential sharpness.

Base sharpness is a weapon's original sharpness values -- sharpness at Handicraft level 0.
Potential sharpness is a weapon's maximum possible sharpness weapons -- Handicraft level 5.
Within weapon data, this is stored in indices 0 and 5 of the durability field, respectively. As of writing, there doesn't seem to be an obvious way to query for data at a specific array index.

The queries below intend ask for weapons with a base white sharpness of 40, then for weapons with a potential white sharpness of 90.

weapons?q={"durability.0.white": { "$gte": 40 }} // Unknown field: durability.0.white
weapons?q={"durability.5.white": { "$gte": 90 }} // Unknown field: durability.5.white

Maintenance decoration missing

  • API: /decorations
  • Decoration: Maintenance Jewel 1
{
    "slug": "maintenance-jewel-1",
    "name": "Maintenance Jewel 1",
    "rarity": 5,
    "slot": 1,
    "skills": [
        {
            "slug": "tool-specialist-rank-1",
            "description": "Reduces the recharge time for specialized tools.",
            "level": 1,
            "skill": 106,
            "skillName": "Tool Specialist"
        },
        {
            "slug": "tool-specialist-rank-2",
            "description": "Reduces the recharge time for specialized tools.",
            "level": 2,
            "skill": 106,
            "skillName": "Tool Specialist"
        },
        {
            "slug": "tool-specialist-rank-3",
            "description": "Reduces the recharge time for specialized tools.",
            "level": 3,
            "skill": 106,
            "skillName": "Tool Specialist"
        }
    ]
}

Inconsistent Skill Modifiers

Some of the skill modifiers (especially the elemental damage ones such as damageFire, damageIce and so on) have inconsistent types in the API (int and String).

This is due to some of the values being just integer numbers or something like 100+5%. While this may technically be accurate information, it pain points while parsing.

I think it would make sense to add new fields to the SkillModifier object to include percent damage modifiers. So you could have damageFire and percentDamageFire to account for new levels of elemental damage adding a flat base amount + an added % bonus.

Add Layered Armor to API

Would be good to add layered armor "sets" to the API.

Not sure if it makes sense to add this to the existing endpoints since the individual pieces of layered armor are not craftable (you have to craft the whole set).

Add resource for attacks

Off the top of my head, something like the following would be useful:

{
      "id": "double-slash",
      "name": "Double Slash",
      "damageType": "severing",
      "motionValues": [8, 10],
      "weaponType": "dual-blades"
}

Add Guiding Land Locations to Monsters

Would be good to add locations monsters can spawn in the Guiding Lands to the monster object. We can also include the spawn change for these based on the level of the guiding lands zone.

Given it's complexity, not sure if it makes sense to put this in the monster endpoint or make it a different endpoint.

Armor list not updated

Hi! First off, I would like to say good job on doing this API service! I'm currently building a hunter-helper, mobile-first web app, using your API. I'm currently focusing on building an Armor Loadout generator and having an updated resource is paramount. I tested the fetch armor endpoint and I can see that the latest armors are missing (Gamma Sets, Behemoth, etc..).

I know that this is a solo project of yours and you have other important things to do. I'm just asking if you could update the resource when you have the time,

Again, good job on this! I've been playing monster hunter since psp days and the project that I'm working on is a passion project of mine. Keep up the good work!

Add Sub-types to Items

Would be nice if items had sub-categories like items or consumables, materials, ammo and maybe a catch all of miscellaneous.

There are a lot of items in the game and some sort of sub-division would be nice to have.

Weapon list not up to date

Hello !
First of all, great job with the API ! I've been using it for a personal project and it's really easy to use and consume.

I've noticed that the Kulve Taroth weapons are missing. I'm currently making a builder with your API and the KT weapons like the Kjaar or the Taroth Glutton HBG are really important and part of the current MHW meta (pre-Iceborne atleast) and they're missing from the weapons API. Could you add them, if it's not too much to ask ? Thanks !

Can support other languages?

Hello! Guys,this project is awesome! I like this project so much and have used it on my personal project.

But i have some question, I am a chinese, when i use the api, I have to translate the res to the simplified chinese and the traditional chinese, so I want this project can support other languages like chinese.I want to set a PR but I'm sorry that I'm not goot at PHP 😭,I can translate this project to simplified chinese and the traditional chinese with my friends. I believe that if this project can have a globalization document, it will be more and more people use it! ( I can learn PHP!

403 error for some weapon images

Hi,

First, thanks so much for building and hosting this API. It's fantastic!

I've noticed a bunch of weapon images which are returning 403 errors. Looks like they're being hosted by S3, so maybe they're configured to expire after X days, and that's causing it?

Here are the affected weapon IDs and URLs:

11
12
31
32
39
40
134
135
136
173
174
175
176
177
180
181
184
185
186
197
198
203
204
205
222
223
224
230
231
232
385
386
441
442
443
447
448
449
450
451
452
453
464
465
466
467
468
469
470
471
474
475
476
477
478
492
493
494
495
496
497
498
499
506
511
523
531
532
533
544
545
546
549
550
551
552
553
554
608
609
610
619
620
633
634
635
636
637
638
639
640
656
657
658
731
732
733
751
752
831
832
833
868
869
870
899
900
909
922
923
924
925
926
937
938
963
964
965
979
980
999
1000
1001
1012
1013
1023
1024
1040
1054
1055
1056
1057
1058

Missing species from The Witcher collaboration

In February 2019 Capcom did a collaboration with The Witcher III including a new species in the game. Should this species (and the corresponding monsters) be in the DB? I think the missions from the event are not longer playable, so I'm not sure if it "deserves" to be included.
Notice that without this species, monsters from that collaboration can't be included in the DB.

Add a 'p' argument to HTTP requests for Mongo projection

As the q argument, it would be great to have a p argument to project result data.
The benefit is great for tool developers to pre-filter what they don't need instead of processing it locally, and for you to save bandwidth consumption (not sure how this is billed, but anyway it is always good to avoid wasting resources).

I tried to provide a p argument but this seemed to not work. Since it is not documented, I assume the feature does not exist yet.

Thanks for your consideration.

Add Monster Hitzone Values

Would be good to have monster hitzone values in the API. I guess these could be added as another field of the monster endpoint.

See here for a good starting point as well as this.

Need more item information

Not to be the one to complain about something so great, but is there a way you can add a little more fluff to the item objects. Perhaps the locations that they can be farmed or quest lines that the items can drop from.

Not sure how you would obtain that but I like using the database. I use it for a Discord bot and its been great content.

Add Buy Cost to Items

Some items can be purchased in the game. This should be indicated in the API with a cost or similar field for the items that can be bought.

See here for viable data set.

Add Droprates to Decorations

Would be good to add feystone drop rates to all decorations. Since there's a fixed set of feystones, we can just have an object embedded in the decorations (maybe like FeystoneDropRates) and just include drop rates (in %) for each stone type.

Invalid CORS header response

I can no longer access the api through front-end web applications. The response appears to have an invalid Access-Control-Allow-Origin header. The error in Chrome is:

Failed to load https://mhw-db.com/skills: The 'Access-Control-Allow-Origin' header contains the invalid value ''

It looks like the header is empty. Pretty sure it's also supposed to contain a wildcard as the rest of the CORS headers have one:

access-control-allow-credentials: false
access-control-allow-headers: *
access-control-allow-methods: *
access-control-allow-origin: 

Add Guiding Lands Reward Type for Monsters

In the monster rewards section, we can already differentiate between high/low/master rank rewards. It would be good however to also add guiding lands rewards. This would basically be the shinies a monster drops in the guiding lands both in its normal form and in it's tempered form (if applicable).

Could this maybe be a new Reward Condition Type?

Missing ElementType Stun

I think the DB is missing an ElementType: stun. It appears in the DB as an Ailment, but I think it also should be an ElementType. It is the same case as sleep and poison.

Skills that are not always active have no modifiers

I believe skills that have modifiers that are not always active (for instance, affinity sliding or heroics) should contain their rank modifiers. It should be up to a consumer of the api to figure out whether or not those modifiers should actually be used (i.e. if simulating or assuming a particular skill is active).

Is there any particular reason that this is the case?

Vagrant plugin issue

Hey Tyler,

This may sound super silly but if you run "vagrant plugin install vagrant-vbguest" on the root directory, it'll throw an error, preventing the required plugin to be installed because it requires said plugin.

unless Vagrant.has_plugin? "vagrant-vbguest"
    raise "The plugin 'vagrant-vbguest' is required to use this configuration. Please run 'vagrant plugin install vagrant-vbguest', and then try again."
end

It's just a heads up, maybe you should check if the command being ran is the installation of vagrant-dbguest.

Add Safi' Jiiva Weapons and Siege

I wanted to open the discussion on how to add the Safi weapons. These may need some special treatment since their upgrade mechanics are a bit different than the other weapons.

Also it would be good to add the Safi' Jiiva siege to the event part of the API since this works similarly to the KT siege. Maybe this just requires updating the web scrapper that pulls event information?

deviation/shellingType value discrepancies

Hi again,

I noticed a few inconsistencies with some of the weapon data. They're not a big deal, but for the sake of consistency, it may be worth correcting.

ID: 1025
attributes.deviation = "Average" instead of "average"

ID: 1173
attributes.deviation = "High" instead of "high"

ID: 673
attributes.shellingType = "Normal LV2" instead of "Normal Lv2"

Fix large amounts of incorrect information being pulled from Kiranico

Taken from @TanukiSharp's analysis of API data in #51.


GreatSword

Buster Blade 3 (id: 6)

  • slot should be '1--' but is '---'

Jagras Hacker 1 (id: 23)

  • element 1 should be '(Water 210)' but is '(Ice 210)'

Jagras Hacker 2 (id: 24)

  • element 1 should be '(Water 240)' but is '(Ice 240)'

Jagras Hacker 3 (id: 25)

  • element 1 should be '(Water 300)' but is '(Ice 300)'

Gnashing Flammenzahn (id: 56)

  • element 1 should be 'Fire 480' but is 'Fire 360'

Daora's Decimator (id: 85)

  • affinity should be 10 but is 0

Wyvern Ignition "Impact" (id: 1181)

  • element 1 should be '(Fire 510)' but is '(Fire 240)'

Missing weapon ガイラブレイズ・水
Missing weapon ガイラブレイズ・氷
Missing weapon ガイラブレイズ・睡眠


LongSword

Brazenridge 2 (id: 111)

  • defense should be 30 but is 25

Missing weapon: Azure Star "Dragon Dance"

  • rarity: 7
  • attack: 495
  • affinity: 30%
  • defense: 0
  • element: 'Water 180'
  • slots: '3--'
  • craft: ?
  • cost: ?
  • augmentation slots: 2

Missing weapon ガイラソード・水
Missing weapon ガイラソード・毒
Missing weapon ガイラソード・麻痺


SwordAndShield

Lumu Tabar 3 (id: 205)

  • slot should be '31-' but is '21-'

Grand Barong 2 (id: 224)

  • defense should be 10 but is 0

Carapace Edge 1 (id: 241)

  • affinity should be -10 but is 0

Carapace Edge 2 (id: 242)

  • affinity should be -10 but is 0

Carapace Edge 3 (id: 243)

  • affinity should be -10 but is 0

Barroth Club 3 (id: 246)

  • slot should be '21-' but is '11-'

Missing weapon ガイラスライサー・水
Missing weapon ガイラスライサー・龍
Missing weapon ガイラスライサー・爆破


DualBlades

Freeze Daggers 2 (id: 280)

  • element 1 should be 'Ice 90' but is 'Ice 60'

Diablos Clubs 2 (id: 308)

  • defense should be 15 but is 10

Dragonbone Twinblades 2 (id: 333)

  • element 1 should be 'Dragon 150' but is 'Dragon 120'

Twin Nails (id: 342)

  • affinity should be 10 but is 0

Fire and Ice (id: 343)

  • affinity should be 10 but is 0

Xeno Raqs (id: 344)

  • affinity should be 15 but is 0

Missing weapon ガイラダガー・水
Missing weapon ガイラダガー・氷
Missing weapon ガイラダガー・毒


Hammer

Lightning Bash 1 (id: 376)

  • element 1 should be 'Thunder 240' but is 'Thunder 832'

Diablos Sledge 2 (id: 403)

  • element 1 should be '(Ice 150)' but is '(Ice 120)'

Anja Striker 3 (id: 416)

  • element 1 should be 'Fire 450' but is 'Fire 390'

Dragonbone Basher 3 (id: 419)

  • slot should be '1--' but is '---'

Icesteel Hammer (id: 424)

  • affinity should be 10 but is 0

Daora's Colossus (id: 425)

  • affinity should be 10 but is 0

Xeno Maph'agarna (id: 426)

  • affinity should be 15 but is 10

Devil's Due (id: 1158)

  • slot should be '---' but is '3--'

Devil's Crush (id: 1159)

  • slot should be '---' but is '3--'

Missing weapon ガイラハンマー・水
Missing weapon ガイラハンマー・雷
Missing weapon ガイラハンマー・氷


HuntingHorn

Gama Horn 1 (id: 472)

  • slot should be '22-' but is '2--'

Gama Horn 2 (id: 473)

  • slot should be '22-' but is '2--'

Lumu Barone 1 (id: 487)

  • element 1 should be '(Water 420)' but is 'Water 420'

Lumu Barone 2 (id: 488)

  • element 1 should be '(Water 480)' but is 'Water 480'

Lumu Barone 3 (id: 489)

  • element 1 should be '(Water 570)' but is 'Water 570'

Missing weapon ガイラバイプ・水
Missing weapon ガイラバイプ・龍
Missing weapon ガイラパイプ・麻痺


Lance

Blue Tail (id: 550)

  • element 1 should be 'Fire 270' but is 'Fire 210'

Garon Lance 2 (id: 574)

  • affinity should be 15 but is 0

Dragonbone Lance 3 (id: 585)

  • slot should be '11-' but is '1--'

Thunderpike (id: 588)

  • affinity should be 10 but is 0

Missing weapon ガイラクレスト・水
Missing weapon ガイラクレスト・雷
Missing weapon ガイラクレスト・睡眠
Missing weapon ガイラクレスト・惨爪


Gunlance

Steel Gunlance 3 (id: 603)

  • has no element but should be '(Blast 210)'

Jyura Buster 1 (id: 626)

  • slot should be '1--' but is '---'

Jyura Buster 2 (id: 627)

  • slot should be '1--' but is '---'

Jyura Buster 3 (id: 628)

  • slot should be '1--' but is '---'

Missing weapon ガイラバスター・水
Missing weapon ガイラバスター・毒
Missing weapon ガイラバスター・睡眠
Missing weapon ガイラバスター・王


SwitchAxe

Power Smasher 1 (id: 716)

  • elderseal should be Average but is None

Power Smasher 2 (id: 717)

  • slot should be '3--' but is '---'
  • elderseal should be Average but is None

Dragonbone Slicer 1 (id: 745)

  • elderseal should be Low but is Average

Dragonbone Slicer 2 (id: 746)

  • elderseal should be Low but is Average

Dragonbone Slicer 3 (id: 747)

  • elderseal should be Low but is Average

Xeno Martshu (id: 755)

  • affinity should be 15 but is 0

Missing weapon ガイラアックス・雷
Missing weapon ガイラアックス・睡眠
Missing weapon ガイラアックス・麻痺
Missing weapon ガイラアックス・角


ChargeBlade

Hard Bone Strongarm 3 (id: 789)

  • slot should be '1--' but is '---'

Missing weapon: Dante's Devil Sword

  • rarity: 8
  • attack: 720
  • affinity: 0%
  • defense: 0
  • element: 'Thunder 150'
  • slots: '11-'
  • phial type: Impact
  • craft: Red Orb x2, Anjanath Gem x1, Odogaron Gem x1, Teostra Mane x4
  • cost: 24000z
  • augmentation slots: 1

Missing weapon ガイラアームズ・雷
Missing weapon ガイラアームズ・氷
Missing weapon ガイラアームズ・睡眠
Missing weapon ガイラアームズ・角


InsectGlaive

Nergal Reaper (id: 839)

  • elderseal should be High but is None

Catastrophe's Light (id: 840)

  • elderseal should be High but is None

Datura Blade 1 (id: 863)

  • slot should be '11-' but is '---'

Hazak Entoma 1 (id: 876)

  • elderseal should be Average but is None

Hazak Entoma 2 (id: 877)

  • elderseal should be Average but is None

Garon Rod 2 (id: 898)

  • slot should be '1--' but is '---'

Dragonbone Glaive 1 (id: 901)

  • elderseal should be Low but is None

Dragonbone Glaive 2 (id: 902)

  • elderseal should be Low but is None

Dragonbone Glaive 3 (id: 903)

  • elderseal should be Low but is None

Blacksteel Glaive 1 (id: 907)

  • elderseal should be Low but is None

Blacksteel Glaive 2 (id: 908)

  • elderseal should be Low but is None

Xeno Shmaena (id: 911)

  • elderseal should be Low but is None

Bad Wing (id: 1170)

  • elderseal should be High but is None

Grunge Storm (id: 1171)

  • elderseal should be High but is None

Missing weapon ガイラブレード・水
Missing weapon ガイラブレード・氷
Missing weapon ガイラブレード・麻痺

Add Item Rewards to Events

I think it would be interesting to add a way to include item drops to events in the API. I'm not sure about the implementation details since the information is scraped, but special rewards could certainly be added via the contribution site.

This would make it easier to filter which events give special rewards which can then be linked to what those special items are used to craft.

Add true attack values in the weapon resource

The muted value next to the displayed attack value is the true attack value with the display modifier taken into account. This would save consumers from having to store display modifier values and calculate true raws themselves.

[Question] Rewards from monsters

First thanks for the great job.

How can I find Rewards from Monsters?

Trying with /monsters but just fewer of than returns data

How to query for all weapon "final forms"?

I was thinking of checking for anything with an empty "crafting.branches" array. Would that make sense?

In any case, I can't get any queries on the crafting field to work, I keep getting the following error:

{"error":{"code":"search.error","message":"An error occurred while running your search: Unknown field: crafting"}}

with a simple query, like so:

https://mhw-db.com/weapons?q={"crafting": {"$exists": true}}

Any ideas?

Insect Glavie Boost Types are Inconsistent

According to the documentation, the types of boost for insect glaive should be one of the following:

sever
speed
element
health
stamina
blunt

However, the API is currently also returning Blunt Boost as a boostType on some Weapons.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.