Autotaxin (ATX) or ecto-nucleotide pyrophosphatase/phosphodiesterase-2 (ENPP2) is a secreted lysophospholipase D that generates the lipid mediator lysophosphatidic acid (LPA), a mitogen and chemo-attractant for many cell types. ATX-LPA signaling has roles in various pathologies including tumour progression and inflammation. However, the molecular basis of substrate recognition and catalysis, and the mechanism of interaction with target cells, has been elusive. Here we present the crystal structure of ATX, alone and in complex with a small-molecule inhibitor. We identify a hydrophobic lipid-binding pocket and map key residues required for catalysis and selection between nucleotide and phospholipid substrates. We show that ATX interacts with cell-surface integrins via its N-terminal somatomedin-B-like domains, using an atypical mechanism. Our results define determinants of substrate discrimination by the ENPP family, suggest how ATX promotes localized LPA signaling, and enable new approaches to target ATX with small-molecule therapeutics.