Complex network analysis (CNA) has appeared as a flexible tool to model systems in multiple fields. With the nodes representing the entities of the system, and the links the relationships among them, CNA allows a topological characterisation of the system, assessing its structure. In recent years, researchers have shown an interest in modelling maritime traffic as a complex network, for analysing connections and relationships among different stakeholders. This paper proposes to model the maritime traffic flow of some food products, traded internationally. The model considers the traffic flows from Spain, allowing to group the partner countries whose traffic flow patterns are similar. These groups (communities), can help decision makers to identify their direct competitors and search for alliances or new markets comparing themselves with those ports that have similar infrastructures. The abovementioned procedure is applied to the export traffic of fruit, vegetables and legumes. Spain is the main fruit and vegetable producer in the EU, the first exporter in the EU and the third in the world. In the Spanish fruit and vegetable sector, part of the products are exported to the EU partly by land, but Spanish ports play a critical role in the transport of this type of goods. The importance of exports to other countries, which are mainly carried out by sea, makes it particularly interesting to study the role of Spanish ports in the export of this type of goods, and the possibilities of improving maritime traffic of these cargo for the Spanish port system. The conclusions derived from the analysis of the export connectivity of Spanish ports for the goods studied are presented, with some of the most important ports for these goods being geographically distant from the production areas, but with a high land connectivity with these regions.