facundoolano / aso

Tools for app store optimization on iTunes and Google Play
MIT License
734 stars 143 forks source link

return 0 when score or reviews is undefined #14

Closed ftcvlad closed 6 years ago

ftcvlad commented 6 years ago

For keyword scores overall difficulty and traffic score may be null. This happens if itunes returns apps with 'score' or 'reviews' fields undefined (for example, if an app doesn't have reviews). Hence, it affects overall difficulty and traffic score calculation.

Example result:

"difficulty": {
    "titleMatches": {
      "exact": 0,
      "broad": 0,
      "partial": 0,
      "none": 10,
      "score": 0
    },
    "competitors": {
      "count": 1,
      "score": 1.09
    },
    "installs": {
      "avg": null
      "score": null
    },
    "rating": {
      "avg": null
      "score": null
    },
    "age": {
      "avgDaysSinceUpdated": 557.1,
      "score": 1
    },
    "score": null
  }
facundoolano commented 6 years ago

Thanks!