Instantly share code, notes, and snippets.

What would you like to do?
List content entries matching specific criteria using the contentful content delivery API
var contentful = require('contentful');
var spaceId = 'someSpaceId';
var accessToken = 'someAccessToken';
var contentTypeId = 'someContentTypeId';
var client = contentful.createClient({
space: spaceId,
accessToken: accessToken,
secure: true,
host: ''
'content_type': contentTypeId,
'fields.pageId': 'all',
'fields.geoCode': 'all'
}, function(err, entries) {
if (err) { console.log(err); return; }
for (var i = 0; i < entries.length; i++) {
var entry = entries[i];
console.log('id: ' +;
console.log('name: ' +;
console.log('pageId: ' + entry.fields.pageId);
id: someId1
name: promo-3
pageId: all,page2,page3
id: someId2
name: promo-2
pageId: all,page5
id: someId3
name: promo-1
pageId: all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment