Is Sports Betting Prohibited in Islam?
Question

I work as a programmer, and one of my clients has asked me to fix some software for him that transmits news of betting on sports from a website to groups on Telegram. I asked him about how this betting works, and he told me that it is different from gambling, as in this type there is no loss of money. The software transmits the latest news of betting. I do not understand these things very well. Among the sports that I saw listed is archery. Please note that the one who controls this type of contest is the client. What is the ruling on this work? Is it regarded as prohibited, because it is not permissible to bet on most sports?
Praise be to Allah.What is meant by betting on sports?
What is meant by betting on sports is when a group of people expect the winner in a particular contest or race to be a particular person. This kind of betting is prohibited, whether it is for money or prizes, or it is free, for the following reasons:

It is akin to false speculation. How does the person know that the outcome will be as he expects?
If it is for money or a prize to be taken from the loser, then this is gambling and is prohibited. If it is to be taken from a third party, then it is a payment for something for which it is not permissible to receive payment.

It is only permissible to accept payment or a prize in the case of horse races, camel races and archery contests, and things that come under the same ruling, such as competitions in memorising the Quran , Hadith and Fiqh, and other things which help to support and spread the religion, because of the report narrated by Abu Dawud (2574), At-Tirmidhi (1700 – and he classed it as sound), and Ibn Majah (2878) from Abu Hurayrah (may Allah be pleased with him), according to whom the Prophet (blessings and peace of Allah be upon him) said: “There should be no prizes for racing except archery contests and races with camels and horses.” (Classed as authentic by Al-Albani in Sahih Abu Dawud and elsewhere.)
What is meant by the prize here is what is given to the one who wins the contest or race, either payment or a prize. Ibn Al-Athir said in An-Nihayah (2/844): “It is what is allocated of money as a pledge for the race.” 
As-Sindi (may Allah have mercy on him) said:
“Al-Khattabi said: That is, it is not permissible to accept payment when racing, except in these two cases, namely racing with camels and horses. And added to that are things that serve a similar purpose, such as training in use of tools of war, because allocating prizes for that encourages people to engage in Jihad and makes it appealing to them." (Hashiyat As-Sindi `Ala Sunan Ibn Majah  2/206)
Ibn Al-Qayyim (may Allah have mercy on him) said in his book Al-Furusiyyah (p. 318): “Question No. 11: Competitions in memorising Quran, Hadith and Fiqh, and other beneficial branches of knowledge, and working out the right answers regarding various issues – is it permissible to do that in return for something?”
The companions of Malik, Ahmad and Ash-Shafi`i disallowed that, but the companions of Abu Hanifah and our shaykh permitted it, and Ibn `Abd Al-Barr narrated that from Ash-Shafi`i. This is more appropriate in the case of wrestling and swimming. If it is permissible to compete in these things in return for some payment, then it is more appropriate that it should be permissible to compete in knowledge. This is similar to the wager that Abu Bakr (may Allah be pleased with him) made with the disbelievers of Quraysh regarding the soundness of what he told them, and that it was definite. We have noted above that there is no Shar`i evidence to prove that that was abrogated, and that Abu Bakr won the wager and collected the prize after gambling was prohibited , and that religion may be supported by means of establishing proof and by means of Jihad. If it is permissible to wager in the case of tools of Jihad and fighting, then it is more appropriate to say that it is permissible to compete and wager on issues of knowledge. And this view is the correct one.” 
It says in Al-Mawsu`ah Al-Fiqhiyyah (23/171): “Betting or wagering may mean several things, one of which is taking risks.
And betting or wagering may be done in the following manner: two people or two parties bet on something that may or may not happen, such as if they say: If it does not rain tomorrow, then I owe you such and such money, otherwise you owe me such and such money.
This type of betting is prohibited – according to the consensus of the jurists, including those who adhere to the rulings of Islam, Muslims and People of the Book – because in either case one of the parties will either win or lose, and this is exactly what prohibited gambling is.”
Is sports betting prohibited in Islam?
It says in Fatawa Al-Lajnah Ad-Da’imah (15/239): 
Question: What is the ruling on betting and what is called “Permissible betting”? What is the ruling if it is done by one party only, such as if someone says: If this thing happens, then I owe you an invitation to a meal, for example? May Allah reward you with good.
Answer: “It is not permissible to bet money or anything else, except in the cases exempted by Allah, which is races with horses or camels, or archery contests. In the case of any other kind of betting, it is not permissible to take money for it, because it comes under the heading of devouring wealth unlawfully, and of gambling, which Allah and His Messenger have prohibited. As for someone saying: If this thing happens to me, then I owe you such and such, this comes under the heading of a promise, and fulfilling it is prescribed, if it is possible to do so.
And Allah is the source of strength. May Allah send blessings and peace upon our Prophet Muhammad and his family and companions.” (Permanent Committee for Academic Research and Ifta’, Bakr ibn `Abdullah Abu Zayd, Salih ibn Fawzan Al-Fawzan… `Abd Al-`Aziz ibn `Abdullah Al Ash-Shaykh, `Abd Al-`Aziz ibn `Abdullah ibn Baz.”
Shaykh Ibn Baz (may Allah have mercy on him) was asked: Some people make bets and say: If such and such happens, I will give you something the value of such and such, otherwise you will give me something, and they call this betting. Is it permissible or prohibited?
He said: “This is not permissible; rather it is prohibited. This betting comes under the heading of gambling , of which Allah, may He be Exalted, says (interpretation of the meaning):
{O you who have believed, indeed, intoxicants, gambling, [sacrificing on] stone alters [to other than Allah], and divining arrows are but defilement from the work of Satan, so avoid it that you may be successful} [Al-Ma’idah 5:90]
What this refers to is gambling, such as saying: If such and such happens, then I owe you such and such, and if such and such happens, then you owe me such and such, or if So and so comes, you owe me such and such, but if he does not come, I owe you such and such, or if what you have is a stone or gold – or whatever the issue that they are arguing about and betting on is. The point is that such bets are regarded as coming under the heading of gambling, and the Prophet (blessings and peace of Allah be upon him) said: “There should be no prizes for racing except archery contests and races with camels and horses .”
What is meant is that there should be no prizes except for archery contests or races with camels and horses.
However, competing in knowledge does not come under this heading; rather it comes under the heading of payment. So if someone says: Whoever learns such and such of the Quran or of the Sunnah or of a particular book will have such and such a prize, this comes under the heading of payment, and it comes under the heading of hiring. The same applies to quizzes with questions about the Quran and Sunnah, in which if someone answers the questions he will have such and such. This comes under the heading of teaching, by way of guiding people to what is good and encouraging them to seek knowledge. This is not included in what is prohibited, because it comes under the heading of encouraging people to seek knowledge and guiding them to what is good, and offering prizes and payment helps people to seek knowledge. As for betting, it is like everyone is trying to beat the other, in which one says such and such and someone else says something else."(Fatawa Nur `Ala Ad-Darb 19/300)
In conclusion, it is not permissible to offer payment or prizes for such betting, whether that is offered by one of the competitors or by some other party.
It is not permissible to bet on expectations, even if that is for something other than money, because that comes under the heading of speculating about the unseen, and it is not permissible to do any programming of software having to do with this betting.
We should point out that what we mean by horse races and archery contests that are permissible is where two people race one another on their horses, or they compete to see whose arrow will hit the target, and not betting on which of the contestants will win.
And Allah knows best.