# API

**URL:** https://community.swiftype.com/c/api/17.md

[Latest](https://community.swiftype.com/latest.md) · [Categories](https://community.swiftype.com/categories.md) · [Tags](https://community.swiftype.com/tags.md)

---

## [About the API category](https://community.swiftype.com/t/about-the-api-category/134)

<div class="topic-metadata">

**Author:** [@system](https://community.swiftype.com/u/system)\
**Replies:** 0\
**Last updated:** [February 3, 2016, 11:31pm UTC](https://community.swiftype.com/t/about-the-api-category/134 "2016-02-03T23:31:11Z")

</div>

All Swiftype API related questions live here!

---

## [Can I index a PDF document using the API?](https://community.swiftype.com/t/can-i-index-a-pdf-document-using-the-api/1034)

<div class="topic-metadata">

**Author:** [@mauricio1](https://community.swiftype.com/u/mauricio1)\
**Replies:** 1\
**Last updated:** [December 18, 2019, 8:44pm UTC](https://community.swiftype.com/t/can-i-index-a-pdf-document-using-the-api/1034 "2019-12-18T20:44:52Z")

</div>

We need to include content from HTML pages and PDF documents in our search results. Our site uses client-side rendering , so we cannot support the web-crawler. How Do we upload the pdf binaries via the API?

---

## [Search function is not working properly](https://community.swiftype.com/t/search-function-is-not-working-properly/1021)

<div class="topic-metadata">

**Author:** [@alessa](https://community.swiftype.com/u/alessa)\
**Replies:** 2\
**Last updated:** [November 15, 2019, 9:32am UTC](https://community.swiftype.com/t/search-function-is-not-working-properly/1021 "2019-11-15T09:32:33Z")

</div>

Hi Dear, We are using swifttype for searching, but there is some issue with the search results like: when we search = ht2635, it returns the result, https://api.swiftype.com/api/v1/public/engines/suggest.json?callback…

---

## [Page contains invalid option: current; must be less than or equal to 100](https://community.swiftype.com/t/page-contains-invalid-option-current-must-be-less-than-or-equal-to-100/869)

<div class="topic-metadata">

**Author:** [@martin](https://community.swiftype.com/u/martin)\
**Replies:** 1\
**Last updated:** [October 31, 2018, 3:00pm UTC](https://community.swiftype.com/t/page-contains-invalid-option-current-must-be-less-than-or-equal-to-100/869 "2018-10-31T15:00:30Z")

</div>

I’m getting this error back when attempting a simple API search to App Search. “Page contains invalid option: current; must be less than or equal to 100” The error message is fairly self-explanatory but I’m dealing wit…

---

## [App Search + AutoComplete](https://community.swiftype.com/t/app-search-autocomplete/877)

<div class="topic-metadata">

**Author:** [@jrhoads](https://community.swiftype.com/u/jrhoads)\
**Replies:** 1\
**Last updated:** [October 31, 2018, 11:29am UTC](https://community.swiftype.com/t/app-search-autocomplete/877 "2018-10-31T11:29:36Z")

</div>

We just signed up for the App Search Pro plan and have a process in place to load our engines via the API calls. It is working great. My question is how do we implement AutoComplete (typeahead sentence completion) with A…

---

## [Facets - Filtering with multiple options](https://community.swiftype.com/t/facets-filtering-with-multiple-options/907)

<div class="topic-metadata">

**Author:** [@karamveer.singh](https://community.swiftype.com/u/karamveer.singh)\
**Replies:** 2\
**Last updated:** [October 31, 2018, 10:46am UTC](https://community.swiftype.com/t/facets-filtering-with-multiple-options/907 "2018-10-31T10:46:14Z")

</div>

I am developing Facets-filtering features by using reference of this article: Faceted Search Guide | Swiftype Documentation . All is working fine but I want to know how we can pass the multi selected facets values to AP…

---

## [Infinite Scroll instead Number Pagination](https://community.swiftype.com/t/infinite-scroll-instead-number-pagination/885)

<div class="topic-metadata">

**Author:** [@karamveer.singh](https://community.swiftype.com/u/karamveer.singh)\
**Replies:** 2\
**Last updated:** [October 8, 2018, 1:16pm UTC](https://community.swiftype.com/t/infinite-scroll-instead-number-pagination/885 "2018-10-08T13:16:40Z")

</div>

Hi, We’re using swiftype-API with Jquery-swiftype.search.js its working fine.Just for the requirement basis we need to show all result in kind of Infinite scroll. Please suggest Is there any way to load result with inf…

---

## [Can spelling corrections be shown to the end user?](https://community.swiftype.com/t/can-spelling-corrections-be-shown-to-the-end-user/506)

<div class="topic-metadata">

**Author:** [@mdeimel](https://community.swiftype.com/u/mdeimel)\
**Replies:** 1\
**Last updated:** [August 3, 2018, 6:30pm UTC](https://community.swiftype.com/t/can-spelling-corrections-be-shown-to-the-end-user/506 "2018-08-03T18:30:20Z")

</div>

I’m looking to see if there is a “did you mean …?” option in Swiftype that can be displayed to the end user? I’ve found this page, which seems to indicate that it is done automatically - and implies that it is not shown…

---

## [Highlighting terms with character encodings](https://community.swiftype.com/t/highlighting-terms-with-character-encodings/805)

<div class="topic-metadata">

**Author:** [@rebecca.deprey](https://community.swiftype.com/u/rebecca.deprey)\
**Replies:** 0\
**Last updated:** [August 3, 2018, 12:31pm UTC](https://community.swiftype.com/t/highlighting-terms-with-character-encodings/805 "2018-08-03T12:31:58Z")

</div>

We’ve recently started using the highlight fields functionality to highlight search terms within content titles and descriptions in our search results. I noticed an issue though where some of our PDF titles have encoded …

---

## [Feature request: In app search api, can we have snippets returned by default](https://community.swiftype.com/t/feature-request-in-app-search-api-can-we-have-snippets-returned-by-default/787)

<div class="topic-metadata">

**Author:** [@apps](https://community.swiftype.com/u/apps)\
**Replies:** 0\
**Last updated:** [July 18, 2018, 11:15pm UTC](https://community.swiftype.com/t/feature-request-in-app-search-api-can-we-have-snippets-returned-by-default/787 "2018-07-18T23:15:35Z")

</div>

Currently snippets are only returned if only specified in the result\_fields. If result\_fields is not provided the results only have the raw data. This would make maintenance and adding of new searchable fields to our a…

---

## [Curl API error using PHP](https://community.swiftype.com/t/curl-api-error-using-php/779)

<div class="topic-metadata">

**Author:** [@maulik.paddhariya](https://community.swiftype.com/u/maulik.paddhariya)\
**Replies:** 0\
**Last updated:** [July 16, 2018, 9:50am UTC](https://community.swiftype.com/t/curl-api-error-using-php/779 "2018-07-16T09:50:53Z")

</div>

Hi , I am trying create a document type using API in PHP language so i have create below code but its appear error and i cant understand how to resolve this . sorry i am newbie. Here is the my code $ch = curl\_init(); …

---

## [Filtering in an array of dates](https://community.swiftype.com/t/filtering-in-an-array-of-dates/776)

<div class="topic-metadata">

**Author:** [@it1](https://community.swiftype.com/u/it1)\
**Replies:** 0\
**Last updated:** [July 13, 2018, 4:27pm UTC](https://community.swiftype.com/t/filtering-in-an-array-of-dates/776 "2018-07-13T16:27:17Z")

</div>

I have an array of date, how can i write a filter to check if my array contains a date greater or smaller than a given date. my array: “departure\_dates”: \[ “2019-09-22”, “2019-07-17” \]

---

## [Strict matching](https://community.swiftype.com/t/strict-matching/743)

<div class="topic-metadata">

**Author:** [@apps](https://community.swiftype.com/u/apps)\
**Replies:** 1\
**Last updated:** [June 21, 2018, 5:18am UTC](https://community.swiftype.com/t/strict-matching/743 "2018-06-21T05:18:29Z")

</div>

Using the app search on the api console and via the api, it seems that the search is fuzzy and I get a lot of random results back. Is there an option to make the default search substring instead of fuzzy? If not, is ther…

---

## [App Search Document Indexing API rate limit](https://community.swiftype.com/t/app-search-document-indexing-api-rate-limit/723)

<div class="topic-metadata">

**Author:** [@apps](https://community.swiftype.com/u/apps)\
**Replies:** 2\
**Last updated:** [June 7, 2018, 5:29pm UTC](https://community.swiftype.com/t/app-search-document-indexing-api-rate-limit/723 "2018-06-07T17:29:40Z")

</div>

I was not able to find any rate limit documentation for document indexing. Can I be provided the rate limit for document indexing api calls? I am assuming that there is one. Thanks, Andrew

---

## [Can not parse dates](https://community.swiftype.com/t/can-not-parse-dates/718)

<div class="topic-metadata">

**Author:** [@george.jovanovic](https://community.swiftype.com/u/george.jovanovic)\
**Replies:** 1\
**Last updated:** [May 30, 2018, 4:53pm UTC](https://community.swiftype.com/t/can-not-parse-dates/718 "2018-05-30T16:53:07Z")

</div>

Hi, I´m new to Swiftype and I´m experiencing problems when indexing date fields. I got the following error when trying to change from text data type to date data type: Value ‘2018-05-29T18:01:00’ cannot be parsed as a d…

---

## [Searching the body of a PDF plus having custom fields](https://community.swiftype.com/t/searching-the-body-of-a-pdf-plus-having-custom-fields/698)

<div class="topic-metadata">

**Author:** [@doug](https://community.swiftype.com/u/doug)\
**Replies:** 1\
**Last updated:** [May 15, 2018, 4:03pm UTC](https://community.swiftype.com/t/searching-the-body-of-a-pdf-plus-having-custom-fields/698 "2018-05-15T16:03:12Z")

</div>

If I use the crawler engine: I get an error when trying to add fields to a document. “This API action is prohibited on Engines created using the Swiftype web crawler.” If I use the API engine: I can’t figure out how t…

---

## [Exact match and case insensitive](https://community.swiftype.com/t/exact-match-and-case-insensitive/328)

<div class="topic-metadata">

**Author:** [@jroque](https://community.swiftype.com/u/jroque)\
**Replies:** 1\
**Last updated:** [May 8, 2018, 3:19pm UTC](https://community.swiftype.com/t/exact-match-and-case-insensitive/328 "2018-05-08T15:19:44Z")

</div>

Hi, I’m doing an exact match search (wrapping the term with quotes) however I also want to make it case insensitive. So right now if I search for “ABC” it only returns record with “ABC” but I want to return “abc” as wel…

---

## [What is an acceptable response time for a simple search query?](https://community.swiftype.com/t/what-is-an-acceptable-response-time-for-a-simple-search-query/672)

<div class="topic-metadata">

**Author:** [@haraldur.karlsson](https://community.swiftype.com/u/haraldur.karlsson)\
**Replies:** 1\
**Last updated:** [April 13, 2018, 10:26pm UTC](https://community.swiftype.com/t/what-is-an-acceptable-response-time-for-a-simple-search-query/672 "2018-04-13T22:26:30Z")

</div>

This is the request to /search.json The index only contains 18 documents. This query has one filter and a 3 character search string. To me this is not really an acceptable response time. Is this normal?

---

## [How to create a "NOT BETWEEN" range filter?](https://community.swiftype.com/t/how-to-create-a-not-between-range-filter/642)

<div class="topic-metadata">

**Author:** [@stefan](https://community.swiftype.com/u/stefan)\
**Replies:** 2\
**Last updated:** [March 29, 2018, 6:22am UTC](https://community.swiftype.com/t/how-to-create-a-not-between-range-filter/642 "2018-03-29T06:22:04Z")

</div>

I tried filtering a set of documents where a fields value is not between 2 values. Is this possible? I guess it had to be a negated range filter but couldn’t find any hints about this.

---

## [Sort by multiple fields (with different directions)](https://community.swiftype.com/t/sort-by-multiple-fields-with-different-directions/633)

<div class="topic-metadata">

**Author:** [@stefan](https://community.swiftype.com/u/stefan)\
**Replies:** 2\
**Last updated:** [March 28, 2018, 3:53am UTC](https://community.swiftype.com/t/sort-by-multiple-fields-with-different-directions/633 "2018-03-28T03:53:16Z")

</div>

Is it possible to sort the search results by multiple fields? Imagine having some simple documents with fields “change date” and “title”. My search should now return the results ordered by “change date” descending (“late…

---

## [Deleting and immediately recreating a document type leads to error](https://community.swiftype.com/t/deleting-and-immediately-recreating-a-document-type-leads-to-error/631)

<div class="topic-metadata">

**Author:** [@stefan](https://community.swiftype.com/u/stefan)\
**Replies:** 1\
**Last updated:** [March 27, 2018, 10:27pm UTC](https://community.swiftype.com/t/deleting-and-immediately-recreating-a-document-type-leads-to-error/631 "2018-03-27T22:27:08Z")

</div>

Hey. To clear all indexed items we first delete a document type and recreate it immediately. Unfortunately we get an error on creating the document type: { "error": "Invalid record. \\nmessage:\\n Validation of Do…

---

## [Backend Admin API](https://community.swiftype.com/t/backend-admin-api/582)

<div class="topic-metadata">

**Author:** [@dboris](https://community.swiftype.com/u/dboris)\
**Replies:** 3\
**Last updated:** [March 27, 2018, 10:16pm UTC](https://community.swiftype.com/t/backend-admin-api/582 "2018-03-27T22:16:56Z")

</div>

Does Swiftype provide an API from some of the backend admin functions? For example is there a way to add synonyms through an API instead of having to log into the admin page?

---

## [Public API Request to see result from specify domain-filter](https://community.swiftype.com/t/public-api-request-to-see-result-from-specify-domain-filter/449)

<div class="topic-metadata">

**Author:** [@gaurav.soni](https://community.swiftype.com/u/gaurav.soni)\
**Replies:** 1\
**Last updated:** [October 26, 2017, 2:37am UTC](https://community.swiftype.com/t/public-api-request-to-see-result-from-specify-domain-filter/449 "2017-10-26T02:37:44Z")

</div>

We have added domain-filter in our webpage. \<meta class="swiftype" name="domain-filter" data-type="string" content="Doc1" /\> \<meta class="swiftype" name="domain-filter" data-type="string" content="Doc2" /\> How can I us…

---

## [Autocomplete requests blocked by X-XSS-Protection](https://community.swiftype.com/t/autocomplete-requests-blocked-by-x-xss-protection/406)

<div class="topic-metadata">

**Author:** [@oddt](https://community.swiftype.com/u/oddt)\
**Replies:** 2\
**Last updated:** [August 4, 2017, 5:47pm UTC](https://community.swiftype.com/t/autocomplete-requests-blocked-by-x-xss-protection/406 "2017-08-04T17:47:10Z")

</div>

Hello, I have a Content Security Policy that explicitly whitelists api.swiftype.com with ‘unsafe-inline’ ‘unsafe-eval’ (not, great, I know). Regular search functionality is working as expected. However, autocomplete req…

---

## [Using the API to specify filters and tags with & (ampersand) in them](https://community.swiftype.com/t/using-the-api-to-specify-filters-and-tags-with-ampersand-in-them/412)

<div class="topic-metadata">

**Author:** [@brave](https://community.swiftype.com/u/brave)\
**Replies:** 1\
**Last updated:** [August 4, 2017, 5:21pm UTC](https://community.swiftype.com/t/using-the-api-to-specify-filters-and-tags-with-ampersand-in-them/412 "2017-08-04T17:21:48Z")

</div>

I noticed that all API requests to filter my search based on a filter which contains ‘&’ fail to give results. The solution was to escape the & into &amp; If you are using the REST endpoint, this then needs to be URL E…

---

## [How can I add document by api?](https://community.swiftype.com/t/how-can-i-add-document-by-api/336)

<div class="topic-metadata">

**Author:** [@elias](https://community.swiftype.com/u/elias)\
**Replies:** 0\
**Last updated:** [March 23, 2017, 5:24am UTC](https://community.swiftype.com/t/how-can-i-add-document-by-api/336 "2017-03-23T05:24:36Z")

</div>

https://api.swiftype.com/api/v1/engines/enginename/document\_types/stores/documents.json?auth\_token=MyAPIKey&document={“external\_id”:“1”,“fields”:\[{“name”:“title”,“value”:“Mat %26 Max”,“type”:“string”}\]} I tried to add d…

---

## [How can I change the URL for an indexed PDF?](https://community.swiftype.com/t/how-can-i-change-the-url-for-an-indexed-pdf/326)

<div class="topic-metadata">

**Author:** [@webdevbyseth](https://community.swiftype.com/u/webdevbyseth)\
**Replies:** 1\
**Last updated:** [March 15, 2017, 8:56pm UTC](https://community.swiftype.com/t/how-can-i-change-the-url-for-an-indexed-pdf/326 "2017-03-15T20:56:33Z")

</div>

I need to index a PDF on a domain (Amazon S3), such as: http://mypdflib.aws.amazon.com/test.pdf \<\< not a real link However, I want the search results to link a PDF viewer page on my main site: http://mysite.com/pdf-vi…

---

## [Can I do a "range" filter on \_score?](https://community.swiftype.com/t/can-i-do-a-range-filter-on--score/249)

<div class="topic-metadata">

**Author:** [@dmorrow](https://community.swiftype.com/u/dmorrow)\
**Replies:** 1\
**Last updated:** [July 13, 2016, 7:39pm UTC](https://community.swiftype.com/t/can-i-do-a-range-filter-on--score/249 "2016-07-13T19:39:32Z")

</div>

I’d like to perform a search, but only get back search results that have a score greater-than 0.5 for instance? I don’t want to get search results where the score is so low. I’d rather just not even have them come back i…
