This article investigates the opportunities and risks that the datafication of primary sources – i.e. not only their digitization but also their transformation into statistical material that can be tabulated – creates for the history of European integration. It uses cases of online digital libraries to show the consequences of digitization policy choices on the way historians can analyse these sources and, as a consequence, write history. We then explain the principle of ‘distant reading’, which stems from the work of the historian Franco Moretti, and try, with a few examples of research already carried out or to be carried out, to illustrate its possibilities for this historiographical school. All in all, we attempt to describe what it is to ‘write the history of European integration’ in the digital era.