User Age

To help you comply with regulations that may require you to restrict access to certain content based on the user's age, Ren'Py exposes platform functionality that gives you a rage of ages for the user. This information is only available on platforms that support it, and may only be available for certain jurisdictions.

renpy.get_user_age()

Returns a range of ages for the user, if such can be determined. It returns a tuple of two integers, giving the minimum and maximum age of the user. If the age cannot be determined, it returns (-1, 150).

This is limited by platform (currently Android and iOS 26+) and the information may only be available in regions of the world where such information is required. It's intended to help you comply with age-related legal requirements, but like the rest of Ren'Py, this feature comes with NO WARRANTY.

On Android, this uses the Play Age Signals API. By using it, you need to agree to the terms at `https://developer.android.com/google/play/age-signals/overview`_, which include limits on how you can process age data.

On iOS, this uses the Declared Age Range API (iOS 26+). To enable it, you must add the com.apple.developer.declared-age-range entitlement to your app by enabling the Declared Age Range capability in Xcode. The entitlement is not present in the Ren'Py iOS template, so you must opt in explicitly before submitting to App Store by going to Signing & Capabilities, clicking the + Capability button, and adding Declared Age Range.

On unsupported platforms, if the entitlement is not available, or no valid age range can be determined, this function returns False.

Example

$ age_lower, age_upper = renpy.get_user_age()

if age_upper < 18:
    # The user is under 18, for sure. Deny them access.
    jump under_18_screen
elif age_lower >= 18:
    # The user is over 18, for sure. Let them in.
    jump bypass_age_check
else:
    # Ask the user their age.
    jump age_check