diff --git a/Changes b/Changes
index 6cd8a9e..111885d 100644
--- a/Changes
+++ b/Changes
@@ -4,6 +4,7 @@
   and context size. (#745)
 - Cleaned up named-vc.  
 - Updated tests using the old match info web-services (#757)
+- Added deprecation warning for the old matchInfo service (#757)
 
 # version 0.73.1
 
diff --git a/src/main/java/de/ids_mannheim/korap/core/service/SearchService.java b/src/main/java/de/ids_mannheim/korap/core/service/SearchService.java
index 03f186d..e616295 100644
--- a/src/main/java/de/ids_mannheim/korap/core/service/SearchService.java
+++ b/src/main/java/de/ids_mannheim/korap/core/service/SearchService.java
@@ -503,7 +503,7 @@
             String textId, String matchId, boolean info, Set<String> foundries,
             String username, HttpHeaders headers, Set<String> layers,
             boolean spans, boolean snippet, boolean tokens,
-            boolean sentenceExpansion, boolean highlights)
+            boolean sentenceExpansion, boolean highlights, boolean isDeprecated)
             throws KustvaktException {
         String matchid = searchKrill.getMatchId(corpusId, docId, textId,
                 matchId);
@@ -540,7 +540,7 @@
         };
 
         results = searchKrill.getMatch(matchid, info, foundryList, layerList,
-                spans, snippet, tokens, highlights, sentenceExpansion, p);
+                spans, snippet, tokens, highlights, sentenceExpansion, p, isDeprecated);
         //        }
         //        catch (Exception e) {
         //            jlog.error("Exception in the MatchInfo service encountered!", e);
diff --git a/src/main/java/de/ids_mannheim/korap/core/web/controller/SearchController.java b/src/main/java/de/ids_mannheim/korap/core/web/controller/SearchController.java
index e78993d..1a8a09a 100644
--- a/src/main/java/de/ids_mannheim/korap/core/web/controller/SearchController.java
+++ b/src/main/java/de/ids_mannheim/korap/core/web/controller/SearchController.java
@@ -261,12 +261,50 @@
             @QueryParam("foundry") Set<String> foundries,
             @QueryParam("layer") Set<String> layers,
             @QueryParam("spans") Boolean spans,
+            @DefaultValue("true") @QueryParam("show-snippet") String snippetStr,
+            @DefaultValue("false") @QueryParam("show-tokens") String tokensStr,
+            @QueryParam("expand") String expansion,
             // Highlights may also be a list of valid highlight classes
             @QueryParam("hls") Boolean highlights) throws KustvaktException {
 
-        return retrieveMatchInfo(ctx, headers, locale, corpusId, docId, textId,
-                matchId, foundries, layers, spans, "true", "false", "sentence",
-                highlights);
+        TokenContext tokenContext = (TokenContext) ctx.getUserPrincipal();
+        try {
+            scopeService.verifyScope(tokenContext, OAuth2Scope.MATCH_INFO);
+        }
+        catch (KustvaktException e) {
+            throw kustvaktResponseHandler.throwit(e);
+        }
+
+        Boolean expandToSentence = true;
+        if (expansion != null
+                && (expansion.equals("false") || expansion.equals("null"))) {
+            expandToSentence = false;
+        }
+        spans = spans != null ? spans : false;
+        Boolean snippet = true;
+        Boolean tokens = false;
+        if (snippetStr != null
+                && (snippetStr.equals("false") || snippetStr.equals("null")))
+            snippet = false;
+
+        if (tokensStr != null && (tokensStr.equals("true")
+                || tokensStr.equals("1") || tokensStr.equals("yes")))
+            tokens = true;
+
+        highlights = highlights != null ? highlights : false;
+        if (layers == null || layers.isEmpty())
+            layers = new HashSet<>();
+
+        try {
+            String results = searchService.retrieveMatchInfo(corpusId, docId,
+                    textId, matchId, true, foundries,
+                    tokenContext.getUsername(), headers, layers, spans, snippet,
+                    tokens, expandToSentence, highlights, true);
+            return Response.ok(results).build();
+        }
+        catch (KustvaktException e) {
+            throw kustvaktResponseHandler.throwit(e);
+        }
     }
 
     @GET
@@ -320,7 +358,7 @@
             String results = searchService.retrieveMatchInfo(corpusId, docId,
                     textId, matchId, true, foundries,
                     tokenContext.getUsername(), headers, layers, spans, snippet,
-                    tokens, expandToSentence, highlights);
+                    tokens, expandToSentence, highlights, false);
             return Response.ok(results).build();
         }
         catch (KustvaktException e) {
diff --git a/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java b/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
index cf96e3b..e4de9dc 100644
--- a/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
+++ b/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
@@ -203,7 +203,8 @@
     public String getMatch (String id, boolean info, List<String> foundries,
             List<String> layers, boolean includeSpans, boolean includeSnippet,
             boolean includeTokens, boolean includeHighlights,
-            boolean sentenceExpansion, Pattern licensePattern)
+            boolean sentenceExpansion, Pattern licensePattern, 
+            boolean isDeprecated)
             throws KustvaktException {
         Match km;
         if (index != null) {
@@ -223,6 +224,13 @@
             km = new Match();
             km.addError(601, "Unable to find index");
         }
+        
+        if (isDeprecated) {
+            km.addWarning(StatusCodes.DEPRECATED,
+                    "This service is deprecated. Please use the following service"
+                    + " URL instead: {version}/corpus/{corpusId}/{docId}/"
+                    + "{textId}/{matchId}");
+        }
         return km.toJsonString();
     };
 
diff --git a/src/test/java/de/ids_mannheim/korap/web/controller/MatchInfoControllerTest.java b/src/test/java/de/ids_mannheim/korap/web/controller/MatchInfoControllerTest.java
index 21f2155..454f9ae 100644
--- a/src/test/java/de/ids_mannheim/korap/web/controller/MatchInfoControllerTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/controller/MatchInfoControllerTest.java
@@ -53,6 +53,23 @@
                 node.at("/errors/0/1").asText());
         assertTrue(node.at("/snippet").isMissingNode());
     }
+    
+    @Test
+    public void testUsingDeprecatedMatchInfoService () throws KustvaktException {
+        Response response = target().path(API_VERSION).path("corpus")
+                .path("GOE").path("AGA").path("01784").path("p36-100")
+                .path("matchInfo")
+                .queryParam("foundry", "*").request().get();
+        assertEquals(Status.OK.getStatusCode(), response.getStatus());
+        String entity = response.readEntity(String.class);
+        JsonNode node = JsonUtils.readTree(entity);
+        assertEquals(StatusCodes.DEPRECATED,
+                node.at("/warnings/0/0").asInt());
+        assertEquals("This service is deprecated. Please use the following "
+                + "service URL instead: {version}/corpus/{corpusId}/{docId}/"
+                + "{textId}/{matchId}",
+                node.at("/warnings/0/1").asText());
+    }
 
     @Test
     public void testGetMatchInfoWithAuthentication () throws KustvaktException {
@@ -103,6 +120,7 @@
                                         "kustvakt2015"))
                 .header(HttpHeaders.X_FORWARDED_FOR, "170.27.0.32").get();
         JsonNode node = JsonUtils.readTree(response.readEntity(String.class));
+        
         assertEquals(StatusCodes.AUTHORIZATION_FAILED,
                 node.at("/errors/0/0").asInt());
         assertEquals(
