Extract Dates API

Extract dates from a given text. The API will return a list of dates with their positions in the text and the normalized form of the date. A large list of date formats is supported. For example, the text could contain dates in the form of "April 5th, 2035", "04/05/2035", or "05.04.2035". The normalized date is the date in the form of a timestamp (milliseconds since 1970).

GET
https://api.apileague.com/extract-dates
Example Request and Response
GET
https://api.apileague.com/{{ examples.getExtractDates }}
{
    "dates": [
        {
            "start_position": 3,
            "date": "April 5th, 2035",
            "normalized_date": 2059336800000,
            "tag": "DATETIME",
            "end_position": 18
        }
    ]
}
cURL
Java
Javascript
Python
Go
C#
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}
 {{ codeCopyText }}

Frequently Asked Questions

What date formats are supported?

The API supports a vast array of date formats, including standard formats like "YYYY-MM-DD", textual formats like "April 5th, 2035", and relative dates like "tomorrow" or "next Friday".

Does it extract dates from the future?

Yes, the API extracts any date mentioned in the text, whether it is in the past, present, or future.

What is the normalized date format?

The normalized date is returned as a timestamp (milliseconds since the Unix epoch, January 1, 1970), allowing for easy programmatic comparison and storage.

How is the Extract Dates API different from the Extract Publish Date API?

The Extract Dates API finds all dates mentioned within a text, whereas the Extract Publish Date API specifically looks for the publication date of a web page or article.

Questions? Need Help? Ask Away