Skip to main content

The cricapi, Free to use, super-high bandwidth, high performance Cricket API. Targeted at Developers and Cricket lovers.

Project description

cricapi

image image image codecov.io image

The cricapi, Free to use, super-high bandwidth, high performance Cricket API. Targeted at Developers and Cricket lovers.
The endpoints exposed are as follows:

  • cricapi.cricket( ) provides live scrores of ongoing match
  • cricapi.matches( ) provides upcoming match fixtures
  • cricapi.matchCalender( ) provides international fixtures
  • cricapi.cricketScore( ) provides detailed score card of the match
  • cricapi.playerStats( ) provides players carrer info and stats
  • cricapi.fantasySummary( ) provides match info and stats
  • cricapi.fantasySquad( ) provides team players info
  • cricapi.playerFinder( ) provides players ids matching given name string

In order to use the above endpoints, u need to have an api_key which can use generated by signing into cricpapi. For testing purpose can use test_api_key "TESTKEY0273"

Usage of Cricapi:

>>> apikey = "TESTKEY0273"
>>> cricapi = Cricapi(apikey)

matches

>>> cricapi.matches()
{u'matches': [{u'toss_winner_team': u'Australia Women', u'team-2': u'Pakistan Women' ...}

cricket

>>> cricapi.cricket()
{u'v': u'1', u'cache': True, u'provider': {u'url': u'https://cricapi.com/', u'source': ...}

matchCalender

>>> cricapi.matchCalender()
{u'v': u'1', u'cache': True, u'provider': {u'url': u'https://cricapi.com/', u'source': ...}

cricketScore

>>> params = {'unique_id':1034809}
>>> cricapi.cricketScore(params)
{u'v': u'1', u'ttl': 3, u'team-2': u'India', u'matchStarted': True, u'team-1': u'England', u'provider': {u'url':u'https://cricapi.com/', u'source': u'Various', u'pubDate': u'2018-10-23T06:58:07.090Z'}, u'creditsLeft': 206}

playerStats

>>> params = {'pid':35320}
>>> cricapi.playerStats(params)
{u'profile': u"\n\nSachin Tendulkar has been the most complete batsman of his time, the most prolific runmaker of all time, and arguably the biggest cricket icon the game has ...}

fantasySquad

>>> params = {'unique_id':1034809}
>>> cricapi.fantasySquad(params)
{u'v': u'1', u'cache': True, u'provider': {u'url': u'https://cricapi.com/', u'source': u'Various', u'pubDate': u'2018-10-23T07:16:02.191Z'}, u'squad': [{u'players': [{u'pid': ... }

fantasySummary

>>> params = {'unique_id':1034809}
>>> cricapi.fantasySummary(params)
{u'type': u'Test', u'ttl': 7, u'provider': {u'url': u'https://cricapi.com/', u'source': u'Various', u'pubDate': u'2018-10-23T07:20:22.701Z'}, u'dateTimeGMT': u'2016-11-09T04:00:00.000Z', u'v': u'1', u'data': {u'toss_winner_tea ...}

playerFinder

>>> params = {'name':'sachin'}
>>> cricapi.playerFinder(params)
{u'ttl': 164, u'provider': {u'url': u'https://cricapi.com/', u'source': u'Various', u'pubDate': u'2018-10-23T07:24:47.164Z'}, u'v': u'1', u'data': [{u'fullName': u'Sachin Rana', u'pid': 33757, u'name': u'Sachin Rana'}, {u'full ...}

Cricapi officially supports Python 2.7 & 3.4–3.7, and runs great on PyPy.

Installation

To install Cricapi, simply use pipenv (or pip, of course):

$ pipenv install cricapi

Documentation

Fantastic documentation is available at http://docs.python-cricapi.org/.

How to Contribute

  1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug. There is a Contributor Friendly tag for issues that should be ideal for people who are not very familiar with the codebase yet.
  2. Fork the repository on GitHub to start making your changes to the master branch (or branch off of it).
  3. Write a test which shows that the bug was fixed or that the feature works as expected.
  4. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cricapi-1.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

cricapi-1.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

cricapi-1.1-py2.py3-none-any.whl (8.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file cricapi-1.1.tar.gz.

File metadata

  • Download URL: cricapi-1.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for cricapi-1.1.tar.gz
Algorithm Hash digest
SHA256 fff0ec51c433468024fe5b4aec8b0735b8e635f151c2676aa9455ab2265f4fdf
MD5 4bee6edc26a816b30776dec0b8a5a445
BLAKE2b-256 72ee89c7b7415160ba344595943c47fc084b029896506a95075c4799ee6849e1

See more details on using hashes here.

File details

Details for the file cricapi-1.1-py3-none-any.whl.

File metadata

  • Download URL: cricapi-1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for cricapi-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8809d0baa5cfa3264e462563f448e5c6c9a5d0a5c902fba7a99d357fdc67355e
MD5 beb64e6bca525da0ffdb7efb5e7db6ca
BLAKE2b-256 810804175662e28a9dd3aeea6d6a843e2126859621dfe2d5ef64cd6ae6362449

See more details on using hashes here.

File details

Details for the file cricapi-1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: cricapi-1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for cricapi-1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d982d5005ed6da436c6bad97a00809728e81073feb4c7be635e489a016cbd116
MD5 9a7f8b02980ca0201964610b0b72034b
BLAKE2b-256 bd54e62836be2992aabbae9d1dbf18807d7188d16853ad1f6ac1172accd268eb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page