Is It Sinful to Use Unofficial APIs Against Terms of Service?
Shafi'i Fiqh
Answered by Shaykh Irshaad Sedick
Question
Is it permissible to develop a tool that collects limited public data from Amazon via unofficial APIs, knowing Amazon’s terms prohibit automated data collection?
Answer
In the Name of Allah, the Most Merciful and Compassionate.
To put it simply, it would not be permissible to create a tool that collects data from Amazon using unofficial APIs if doing so would violate their terms of service. Islam emphasizes the importance of honoring agreements and maintaining upright conduct, whether we are dealing with Muslims or non-Muslims.
It’s best to move forward only in ways that are fully compliant and clear of any contractual breaches.
Respecting Terms of Service
Islam teaches us to take contracts and agreements very seriously. Allah Most High says,
“O you who believe, fulfill your agreements” [Quran, 5:1]
When you access Amazon’s services, even the publicly available sections, you effectively agree to abide by their stated terms. If they explicitly forbid automated data gathering, ignoring that would amount to breaking a binding agreement, which is not allowed.
The Prophet Muhammad (Allah bless him and give him peace) said:
“The believers are bound by their conditions, except for a condition that makes lawful what is unlawful, or makes unlawful what is lawful.” [Tirmidhi]
This hadith makes it clear that we are morally and religiously bound to uphold our agreements unless they involve something inherently forbidden or obligatory, which isn’t the case here.
The Nature of Public Data
It’s true that some data on Amazon may be publicly visible, but just because something is accessible doesn’t mean it’s free from restrictions. Islamic ethics teaches us to look not just at what we can access, but also at how we access it and whether that method is sound and respectful.
The scholars have pointed out that causing harm (darar) or betraying trust (khiyana) is forbidden, even when dealing with non-Muslim individuals or companies—unless there is clear wrongdoing on their part, in which case specific scholarly advice would be needed.
Alternative and Lawful Methods
If gathering data is important for your project or work, it’s worth considering permissible alternatives, such as:
- Asking Amazon directly for permission.
- Making use of official APIs or services, even if they come with some restrictions or costs.
- Setting up a formal agreement or partnership that allows you to access the information properly.
Choosing a permissible and honest path will bring baraka (divine blessing) to your efforts and protect you from difficulties, both in this life and in the Hereafter.
And Allah knows best.
[Shaykh] Irshaad Sedick
Checked and Approved by Shaykh Faraz Rabbani
Shaykh Irshaad Sedick was raised in South Africa in a traditional Muslim family. He graduated from Dar al-Ulum al-Arabiyyah al-Islamiyyah in Strand, Western Cape, under the guidance of the late world-renowned scholar Shaykh Taha Karaan (Allah have mercy on him), where he taught.
Shaykh Irshaad received Ijaza from many luminaries of the Islamic world, including Shaykh Taha Karaan, Shaykh Muhammad Awama, Shaykh Muhammad Hasan Hitu, and Mawlana Abdul Hafeez Makki, among others.
He is the author of the text “The Musnad of Ahmad ibn Hanbal: A Hujjah or not?” He has been the Director of the Discover Islam Centre, and for six years, he has been the Khatib of Masjid Ar-Rashideen, Mowbray, Cape Town.
Shaykh Irshaad has fifteen years of teaching experience at some of the leading Islamic institutes in Cape Town). He is currently building an Islamic podcast, education, and media platform called ‘Isnad Academy’ and has completed his Master’s degree in the study of Islam at the University of Johannesburg. He has a keen interest in healthy Prophetic living and fitness.