How to use the google-play-scraper.search function in google-play-scraper

To help you get started, we’ve selected a few google-play-scraper examples, based on popular ways it is used in public projects.

github SwitchbladeBot / switchblade / src / commands / search / playstore.js View on Github external
async run ({t, author, channel, language}, country, term) {
    channel.startTyping()
    console.log(term)
    const embed = new SwitchbladeEmbed(author)
    const response = await gplay.search({term, country, num: 1, lang: language.substring(0, 1)})
    if (response.length > 0) {
      const app = response[0]
      embed
        .setColor(0x518FF5)
        .setThumbnail('http://' + app.icon)
        .setAuthor('Google Play Store', 'https://i.imgur.com/tkTq2bi.png')
        .setDescription([
          `**[${app.title}](${app.url})**`,
          app.summary,
          '',
          MiscUtils.ratingToStarEmoji(app.score),
          app.priceText
        ].join('\n'))
    } else {
      embed
        .setColor(Constants.ERROR_COLOR)
github GilbertGobbels / GAwesomeBot / Commands / Public / linkme.js View on Github external
const fetchApp = (i, cb) => {
			if (i >= apps.length) {
				return cb();
			} else {
				gplay.search({
					term: apps[i],
					num: 1,
				}).then((data, err) => {
					if (!err && data && data.length > 0) {
						results.push({
							color: 0x00FF00,
							author: {
								name: `By ${data[0].developer}`,
							},
							thumbnail: {
								url: data[0].icon ? `http:${data[0].icon}` : "",
							},
							title: `__${data[0].title}__`,
							url: `${data[0].url}`,
							description: `A quick summary: \`\`\`\n${data[0].summary}\`\`\``,
							footer: {
github facundoolano / google-play-api / lib / index.js View on Github external
router.get('/apps/', function (req, res, next) {
  if (!req.query.q) {
    return next();
  }

  const opts = Object.assign({term: req.query.q}, req.query);

  gplay.search(opts)
    .then((apps) => apps.map(cleanUrls(req)))
    .then(toList)
    .then(res.json.bind(res))
    .catch(next);
});