about users owners developers faq
Privacy policy

Developers Hints

Using CheckMyAge is easy, the simplest way is to ask people for their CheckMyAge ID (provide a link here for if they don't already have one). Once a visitor has entered their ID you can check it with the following API call to see if its valid:

https://checkmyage.net/api?id=1234&min=18&max=25

This will return 1 if the person's age is within the range specified, 0 if not and a negative number for in case of an error such as suspected hacking attempts. The "min" and "max" values are optional so for example to check a minimum age you will just need to use the "id" and "min".

To find a persons country, use the following:

https://checkmyage.net/api/?id=1234&country=t

We limit the number of API calls per hour to prevent hacking attempts. We recommend website owners contact us at support@checkmyage.net to set-up a affiliation account to avoid this limit or fill in the following form:

Affiliation

Name: Your name or your company name, just so we can call you something when we email you.
Website domain: e.g. checkmyage.net, no need for https or www etc.
Email address:
CheckMyAge ID: So we know you have given your ID and we can trust you.

We will use your email to send you your affiliation codes (+ how to use them) and warn you of any possible future restrictions if they will impact you. We don't (and will never) provide any analytical information on the users that you use our api with although we may give you feedback on how many api calls you made within a given week.

Example code

To integrate CheckMyAge into your website, we recommend you simply ask for a CheckMyAge with a link to our website if they don't already have one. Have a play with the following code to get you started:

<img src="https://checkmyage.net/logo1.svg" width="200">
<h2>Verification</h2>
Please enter your CheckMyAge ID <br>
<form action="" method="post">
<input type="text" name="cmaid" value="">
<br>
<input type="submit" value="Verify" name="submit"></p>
</form>
<p><i>If you don't have a CheckMyAge ID, you can get one for free by visiting <a href="https://checkmyage.net" target="_new" rel="noopener noreferrer">CheckMyAge.net</a>.</i></p>

You can then verify the code with some php like the following (checks that the person relating to the id is over 18:

<?php
$cma_id = preg_replace('/[^a-zA-Z0-9]/', '', $_POST["cmaid"]);
$cma_valid = false;
if (strlen($cma_id)>5) {
  if (preg_replace('/[^0-9-]/','',file_get_contents('https://checkmyage.net/api?min=18&id='.$cma_id)) == "1")
    $cma_valid = true;
}
?>

Hope that gives you some pointers even if you are not using php. The following javascipt may also help:

<script>
var r = new XMLHttpRequest();
var cma_id = "1234";
r.open('GET', 'https://checkmyage.net/api?min=18&id='+cma_id, false);
r.send(null); 
if (r.status == 200) { alert(r.responseText); }
</script>

We hope to provide some help for WordPress users soon.