ALGIERS, July 21 (Reuters) - OPEC member Algeria posted a trade deficit of $7.78 billion for the first half of 2015, reversing a $3.2 billion surplus a year earlier, due to lower earnings as oil prices slumped, official data showed on Tuesday.

That meant revenue from Algeria's exports could cover only 71 percent of the cost of its imports, compared to covering 111 percent of import costs in the first six months of 2014.

The deficit was $6.3 billion in the first five months of the year.

Oil and gas exports, which accounted for 94 percent of Algeria's total exports, dropped 43.71 percent to $18.09 billion in the January-June period, according to customs figures.

The value of overall exports during the period fell 42 percent year-on-year to $19.28 billion, while imports declined 10 percent to $27.07 billion, the data showed. Algeria has been trying to restrict imports to offset the fall in oil prices.

(Reporting by Hamid Ould Ahmed; Editing by Tom Heneghan) ((hamid.ouldahmed@thomsonreuters.com;))

Keywords: ALGERIA TRADE/DEFICIT