npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

transfermarkt-parser

v0.1.1

Published

A small tool for parsing https://www.transfermarkt.com

Downloads

1

Readme

Transfermarkt Parser

Set of javascript parsers for https://www.transfermarkt.com website.

Demo: https://mlipilin.github.io/transfermarkt-parser

Installation

You can install this library using NPM:

npm install transfermarkt-parser

or Yarn:

yarn add transfermarkt-parser

Usage

import { country } from 'transfermarkt-parser'

const countries = await country.list()

Available parsers

Country

import { country } from 'transfermarkt-parser'

// Get all countries
const countries = await country.list()

// [
//   {
//     "flagUrl": "https://tmssl.akamaized.net//images/flagge/small/1.png",
//     "id": 1,
//     "title": "Afghanistan"
//   },
//   {
//     "flagUrl": "https://tmssl.akamaized.net//images/flagge/small/3.png",
//     "id": 3,
//     "title": "Albania"
//   },
//   ...
//   {
//     "flagUrl": "https://tmssl.akamaized.net//images/flagge/small/187.png",
//     "id": 187,
//     "title": "Zimbabwe\""
//   }
// ]

Competition

import { competition } from 'transfermarkt-parser'

// Get all available competitions for England
const competitions = await competition.list(189)

// [
//   {
//     "countryId": 189,
//     "id": "GB1",
//     "logoUrl": "https://tmssl.akamaized.net//images/logo/normal/gb1.png",
//     "title": "Premier League"
//   },
//   {
//     "countryId": 189,
//     "id": "GB2",
//     "logoUrl": "https://tmssl.akamaized.net//images/logo/normal/gb2.png",
//     "title": "Championship"
//   },
//   ...
//   {
//     "countryId": 189,
//     "id": "GBFL",
//     "logoUrl": "https://tmssl.akamaized.net//images/logo/normal/gbfl.png",
//     "title": "EFL Trophy"
//   }
// ]

Season

import { season } from 'transfermarkt-parser'

// Get all available seasons for English Premier League
const seasons = await season.list('GB1')

// [
//   {
//     "competitionId": "GB1",
//     "id": "2022",
//     "title": "22/23"
//   },
//   {
//     "competitionId": "GB1",
//     "id": "2021",
//     "title": "21/22"
//   },
//   ...
//   {
//     "competitionId": "GB1",
//     "id": "1992",
//     "title": "92/93"
//   }
// ]

Club

import { club } from 'transfermarkt-parser'

// Get all clubs for English Premier League (season 22/23)
const clubs = await club.list('GB1', '2022')

// [
//   {
//     "id": 281,
//     "logoUrl": "https://tmssl.akamaized.net//images/wappen/head/281.png",
//     "title": "Manchester City"
//   },
//   {
//     "id": 631,
//     "logoUrl": "https://tmssl.akamaized.net//images/wappen/head/631.png",
//     "title": "Chelsea FC"
//   },
//   ...
//   {
//     "id": 989,
//     "logoUrl": "https://tmssl.akamaized.net//images/wappen/head/989.png",
//     "title": "AFC Bournemouth"
//   }
// ]

Matchday

import { matchday } from 'transfermarkt-parser'

// Get all matchdays for English Premier League (season 22/23)
const matchdays = await matchday.list('GB1', '2022')

// [
//   {
//     "competitionId": "GB1",
//     "id": 1,
//     "seasonId": "2022",
//     "title": "1.Matchday"
//   },
//   {
//     "competitionId": "GB1",
//     "id": 2,
//     "seasonId": "2022",
//     "title": "2.Matchday"
//   },
//   ...
//   {
//     "competitionId": "GB1",
//     "id": 38,
//     "seasonId": "2022",
//     "title": "38.Matchday"
//   }
// ]

Game

import { game } from 'transfermarkt-parser'

// Get all games for Matchday 1 of English Premier League (season 22/23)
const games = await game.list('GB1', '2022', 1)

// [
//   {
//     "club1Goals": 0,
//     "club2Goals": 2,
//     "club1Id": 873,
//     "club2Id": 11,
//     "competitionId": "GB1",
//     "id": "3837814",
//     "matchday": 1,
//     "seasonId": "2022"
//   },
//   {
//     "club1Goals": 2,
//     "club2Goals": 2,
//     "club1Id": 931,
//     "club2Id": 31,
//     "competitionId": "GB1",
//     "id": "3837815",
//     "matchday": 1,
//     "seasonId": "2022"
//   },
//   ...
//   {
//     "club1Goals": 0,
//     "club2Goals": 2,
//     "club1Id": 379,
//     "club2Id": 281,
//     "competitionId": "GB1",
//     "id": "3837823",
//     "matchday": 1,
//     "seasonId": "2022"
//   }
// ]

Player

import { player } from 'transfermarkt-parser'

// Get all players for Manchester City (season 22/23)
const players = await player.list(281, '2022')

// [
//   {
//     "id": 238223,
//     "name": "Ederson",
//     "birthday": "1993-08-17",
//     "nationalities": [
//       "Brazil",
//       "Portugal"
//     ],
//     "number": 31,
//     "photoUrl": "https://img.a.transfermarkt.technology/portrait/big/238223-1661978747.jpg?lm=1",
//     "position": "Goalkeeper"
//   },
//   {
//     "id": 85941,
//     "name": "Stefan Ortega",
//     "birthday": "1992-11-06",
//     "nationalities": [
//       "Germany",
//       "Spain"
//     ],
//     "number": 18,
//     "photoUrl": "https://img.a.transfermarkt.technology/portrait/big/85941-1668065114.jpg?lm=1",
//     "position": "Goalkeeper"
//   },
//   ...
//   {
//     "id": 576024,
//     "name": "Julián Álvarez",
//     "birthday": "2000-01-31",
//     "nationalities": [
//       "Argentina"
//     ],
//     "number": 19,
//     "photoUrl": "https://img.a.transfermarkt.technology/portrait/big/576024-1661978290.jpg?lm=1",
//     "position": "Centre-Forward"
//   }
// ]