Coder Social home page Coder Social logo

rezarahiminia / free-api-worldcup2022 Goto Github PK

View Code? Open in Web Editor NEW
239.0 12.0 35.0 64 KB

Grab your football API data for FIFA World Cup 2022 competition!

world-cup-2022 live-scores realtime worldcup2022 world-cup-api worldcupapi worldcupqatar qatar2022

free-api-worldcup2022's Introduction

"Buy Me A Coffee"

WORLD CUP API - 2022 DATA SET

Live Scores(Real-time player stats)

free-api-worldcup2022

World Cup 2022

Grab your football API data for FIFA World Cup 2022 competition!

Register

To use the services, you must register (free registration) You need a token to call services

Http Metod : POST http://api.cup2022.ir/api/v1/user

Request

curl --location --request POST 'http://api.cup2022.ir/api/v1/user' \
--header 'Content-Type: application/json' \
--data-raw '{
"name" : "Reza RAhiminia",
"email": "[email protected]",
"password": "******",
"passwordConfirm" : "******"
}'

Response

{
	"status": "success",
	"message": "User created",
		"data": {
		"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2MjliMjJlYTZiOGYwZTVlNGNkZDcxZDMiLCJpYXQiOjE2NTQzMzQxODYsImV4cCI6MTY1NDQyMDU4Nn0.zgWUXkDCcche_5G9UnPB4VeXP68IKIRZm1UfjM457tU"
		}
}

Login

Be sure to log in to use the services You need a token to call services

Http Metod : POST http://api.cup2022.ir/api/v1/user/login

Request

curl --location --request POST 'http://api.cup2022.ir/api/v1/user/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "[email protected]",
"password": "12345678"
}'

Response

{
"status": "success",
	"data": {
	"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2MjliMjJlYTZiOGYwZTVlNGNkZDcxZDMiLCJpYXQiOjE2NTQzMzQzMTgsImV4cCI6MTY1NDQyMDcxOH0.fP6smP8HB_QHQhAPktB08FEMor_BqOQhzlgXNkN756U"
	}
}

Teams

A request on Team endpoint returns all information about the All Team

Http Metod : GET http://api.cup2022.ir/api/v1/team

A request on Team endpoint returns all information about the by Team

Http Metod : GET http://api.cup2022.ir/api/v1/team/{id}

Request

curl --location --request GET 'http://api.cup2022.ir/api/v1/team' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \

Response

{
	"status": "success",
	"data": [
		{
			"_id": "62965f29800713e332e613f8",
			"name_en": "Iran",
			"name_fa": "ایران",
			"flag": "https://en.wikipedia.org/wiki/File:Flag_of_Iran.svg",
			"fifa_code": "IRN",
			"iso2": "IR",
			"groups": "B",
			"id": "6"

		}]
}

Matches

A request on Matches endpoint returns all Matches information

Http Metod : GET http://api.cup2022.ir/api/v1/match

A request on Matches endpoint returns all information for the requested day (e.g. 2 is second day's matches of cup) [day match's]

Http Metod : GET http://api.cup2022.ir/api/v1/bymatch/{id}

A request on Matches endpoint returns all information about the Match [match]

Http Metod : GET http://api.cup2022.ir/api/v1/match/{id}

A request on Matches endpoint returns all information about the Match [date match]

Http Metod : POST http://api.cup2022.ir/api/v1/bydate

{"date":"12/2/2022"}

Request

curl --location --request GET 'http://api.cup2022.ir/api/v1/match' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \

Response

{

	"status": "success",
	"data": [
		{
		"id": 1,
		"type": "group",
		"group": "A",
		"home_team_id": "3",
		"away_team_id": "4",
		"home_score": 0,
		"away_score": 0,
		"home_scorers": null,
		"away_scorers": null,
		"persian_date": "1400-08-30 13:30",
		"local_date": "2022-11-21 1:00 PM",
		"stadium_id": "1",
		"time_elapsed": "finished",      notstarted | h1 | hf | h2 | finished
		"finished": "true",
		"matchday": 1,
		"home_team_fa": "سنگال",
		"away_team_fa": "هلند",
		"home_team_en": "Senegal",
		"away_team_en": "Nederland",
		"home_flag": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/fd/Flag_of_Senegal.svg/125px-Flag_of_Senegal.svg.png",
		"away_flag": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Flag_of_the_Netherlands.svg/125px-Flag_of_the_Netherlands.svg.png"
		}]
}

Standings

A request on Standings endpoint returns all Standings information

Http Metod : GET http://api.cup2022.ir/api/v1/standings

A request on Standings endpoint returns all information Standings by group [day match's]

Http Metod : GET http://api.cup2022.ir/api/v1/standings/{group name : A,B,...}

Request

curl --location --request GET 'http://api.cup2022.ir/api/v1/standings' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \

Response

{
"status": "success",
"data": [
		{
		"group": "A",
		"teams": [
						{
						"team_id": "1",
						"mp": "0",
						"w": "0",
						"l": "0",
						"pts": "0",
						"gf": "0",
						"ga": "0",
						"gd": "0",
						"d": "0",
						"name_fa": "قطر",
						"name_en": "Qatar",
						"flag": "https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/Flag_of_Qatar.svg/125px-Flag_of_Qatar.svg.png"
						},
						{
						"team_id": "2",
						"mp": "0",
						"w": "0",
						"l": "0",
						"pts": "0",
						"gf": "0",
						"ga": "0",
						"gd": "0",
						"d": "0",
						"name_fa": "اکوادور",
						"name_en": "Ecuador",
						"flag": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Flag_of_Ecuador.svg/125px-Flag_of_Ecuador.svg.png"
						},
						{
						"team_id": "3",
						"mp": "0",
						"w": "0",
						"l": "0",
						"pts": "0",
						"gf": "0",
						"ga": "0",
						"gd": "0",
						"d": "0",
						"name_fa": "سنگال",
						"name_en": "Senegal",
						"flag": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/fd/Flag_of_Senegal.svg/125px-Flag_of_Senegal.svg.png"
						},
						{
						"team_id": "4",
						"mp": "0",
						"w": "0",
						"l": "0",
						"pts": "0",
						"gf": "0",
						"ga": "0",
						"gd": "0",
						"d": "0",
						"name_fa": "هلند",
						"name_en": "Nederland",
						"flag": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Flag_of_the_Netherlands.svg/125px-Flag_of_the_Netherlands.svg.png"
						}]

		}]

}

standings info

 "mp" =>  matches played
 "w"    =>  matches won
 "l"      =>  matches lost
 "pts"  =>  point / score
 "gf"   =>   goals for
 "ga"  =>   goals against
 "gd"  =>   goals difference
 "d"  =>     drawn

###The number of users using this service until 28 Oct 2022

country account
united States 4289
china 3394
brazil 1318
vietnam 738
germany 548
poland 450
israel 352
switzerland 290
argentina 259
chile 231
netherlans 190
taiwan 189
nepal 171
canada 161
united kingdom 155
france 143
iran 116
india 93
colombia 91
morocco 86
finland 86
denmark 81
mexico 75
australia 68
japan 63
bangladesh 62
paraguay 58
uruguay 49
united arab 49
sweden 49
indonesia 48
korea 43
belgium 40
guatemala 36
ecuador 34
russian federation 30
thailand 29
malaysia 29
romania 26
venezuela 25
ireland 21
bolivia 19
peru 18
egypt 17
egypt 17
egypt 17
turkey 16
saudi arabia 12
kenya 10
south africa 9
pakistan 9
jordan 9
austria 9
czechia 8
costa rica 8
panama 6
ukraine 4
myanmar 4
uzbekistan 3
iceland 3
tunisia 2
oman 2
lithuania 2
kazakhstan 2
italy 2
new zeland 1
moldova 1
lebanon 1
kyrgzstan 1
iraq 1
greece 1
ghana 1
bulgaria 1
armenia 1
albania 1

ChangeLog

2022-09-1 : Add 3 Teams => Costa Rica , Wales , Australia

2022-10-31 : Add api Matches by date date

free-api-worldcup2022's People

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  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  avatar  avatar  avatar  avatar

free-api-worldcup2022's Issues

Match Type

Hey mate, once again thanks for your hard work, wondering what the options are for match type:

We get for group stage:
"type": "group",

any idea about next stages values yet?

Will it provide live scores?

hi!

great job! this is the only location I found such an API

My question:
Will it provide live scores? What is the expected delay?

Order match by date

it would be interesting to be able to pass url params to list by date

or change /match endpoint and make it list by date

CORS error

Access to fetch at 'http://api.cup2022.ir/api/v1/bydate' from origin 'null' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Player stats, stadiums etc.

Is this project still a WIP? Are you going to add player information? So which player played in which match who are the TOP scorers etc?
Are you also going to add team formations? so which player played at which location in the team?

just some questions/ideas ;)

"Not authorized to access this resource" after login

Hi! We are trying to use the API but after a couple of days we are getting this error "Not authorized to access this resource". We registered and logged in, and the API was working just fine. After a couple of days, we tried to use it again but we keep getting that message. We tried logging in again and we are still getting the same message.

Goal scorer format

Do you already have a template for the home_scorers and away_scorers? How is the information going to be displayed? If you could provide a JSON example it would be great

Limit requests

Hi, nice work on your api. How many requests do i can? 😁

Cards & Assists?

Hey @Raminmr thank you for this awesome project!
Are there any plans to track yello/red cards and assists during the matches?

Time elapsed values

Hey mate, thanks for the hard work and quick responses.

What are the expected values for time_elapsed on matches endpoints?

time_elapsed: "notstarted"

During the game I guess is going to be minutes:seconds? what about once the match ends?
time_elapsed: "finished" perhaps?

Thanks again!

Having issues talking to the endpoints using fetch api - HTML

I made index.js and created a function registerUser() which gets called upon a button click.

It works with CURL and Postman but not JS.

Here's the function:

const registerUser = async () => {
    let headersList = {
        Accept: "*/*",
        "User-Agent": "Thunder Client (https://www.thunderclient.com)",
        "Content-Type": "application/json",
    };

    let bodyContent = JSON.stringify({
        name: "Username",
        email: "[email protected]",
        password: "0123456789",
        passwordConfirm: "0123456789",
    });

    let response = await fetch("http://api.cup2022.ir/api/v1/user", {
        method: "POST",
        body: bodyContent,
        headers: headersList,
    });

    let data = await response.text();
    console.log(data);
};

error

Please help me out...

Stadium Names?

First congratulations for the work!
I'm consulting the API but it's only listing the ID = 1 in the stadiums, will this functionality be developed?

Could not send request

Hello,
i'm using your API to study Power BI and in this morning when I refresh my datasets doent work. I check postman requests and a understand whats happening, my requests are not sending.

Is it my error or a problem in your API?

Sorry, i'm new in developer's world, so I don't understand much. And i'm brazilian and my english is terrible!

Can we get a schedule endpoint?

Hi, thanks for this API.
I would like to display a calendar, day by day of all the fixtures of the day.

Can we get a general schedule endpoint (chronological sorted?)

thanks!

Error: Request timed out

Good evening, I try to consume any end point and it shows me Error: Request timed out, do you know if the service is down?

Cheers

Wrong USA team name

In the teams endpoint response, the USA team name is "America" while it should be "United States".

{
    "_id": "629c9c6b5749c4077500eaaa",
    "name_en": "America",
    "name_fa": "آمریکا",
    "flag": "https://upload.wikimedia.org/wikipedia/en/thumb/a/a4/Flag_of_the_United_States.svg/125px-Flag_of_the_United_States.svg.png",
    "fifa_code": "USA",
    "iso2": "US",
    "groups": "B",
    "id": "7"
}

504 - Gateway Timeout

image

Thanks for your free api. I used in my app to bet on matches with my friends, but unfortunately I ran into a problem after some time. I wanted to do standings download automation, but now I have connection error.

Is there a lifetime of the tokken or can it be used once downloaded all the time?

Wrong group information

I think the match api is with wrong data.

Brazil, for example, appears in two different groups

image

Use from backend server

I want to use your API because of its nice structure for my own project and practice on the frontend. But I ran into a problem and it's cors, could you guide me with a little explanation of the method of use through the backend? Thanks for your help!

Proper Ducumentation

Hey, I'm trying to make an android app with your API. Can you please explain the full forms of
"mp": "0", "w": "0", "l": "0", "pts": "0", "gf": "0", "ga": "0", "gd": "0",

It is in the Standings endpoint.

URL from example from GET teams wrong

At the example for request the teams the protocol is duplicated.

- curl --location --request GET 'http://http://api.cup2022.ir/api/v1/team' \
+ curl --location --request GET 'http://api.cup2022.ir/api/v1/team' \
 --header 'Authorization: Bearer <token>' \
 --header 'Content-Type: application/json' \

Authorization error...

Will look for another service... Time constraint programmer... Good luck!

p.s. The service is returning the following:

{"error":"Not authorized to access this resource"}

The match endpoint provides invalid dates for the matches

Currently, the match endpoint provides invalid dates of some provided matches. E. g. the match switzerland vs cameroon starts at "2022.11.24 10:00" according to the endpoint. And this isn't the only date which is incorrect. Can you please check your code and update it. Thank you. Besides this issue very good job so far!

Player Data

Hi, firstly I wanted to say great work, really appreciate everything that you've done here! I had a quick question, once all the teams have confirmed their squads, are you going to have individual player data? Thanks!

HTTPS and Access-Control-Allow-Origin for localhost

Hey mate, great work with the API, is it possible to move it to a secure endpoint? (https) as this is causing issues when I try to access the endpoint from a https site.
The other one is that the Access-Control-Allow-Origin header seems is not enabled, so when I'm trying to access the endpoint from my dev machine I get a CORS error

wrong dates

Hello again friend, I discovered another information error, some matches the dates are wrong, I share an example, I really appreciate your help and I congratulate you for your great work with this API.

For this example, the match is 11/26 and not 11/23

Greetings.

image

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.